Update doc and examples (#8)
This commit is contained in:
parent
4458723f48
commit
c71fae6632
@ -35,7 +35,7 @@ services:
|
|||||||
db:
|
db:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=sekret_root_password
|
- MYSQL_RANDOM_ROOT_PASSWORD=true
|
||||||
- MYSQL_DATABASE=monica
|
- MYSQL_DATABASE=monica
|
||||||
- MYSQL_USER=homestead
|
- MYSQL_USER=homestead
|
||||||
- MYSQL_PASSWORD=secret
|
- MYSQL_PASSWORD=secret
|
||||||
|
|||||||
@ -34,7 +34,7 @@ services:
|
|||||||
db:
|
db:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=sekret_root_password
|
- MYSQL_RANDOM_ROOT_PASSWORD=true
|
||||||
- MYSQL_DATABASE=monica
|
- MYSQL_DATABASE=monica
|
||||||
- MYSQL_USER=homestead
|
- MYSQL_USER=homestead
|
||||||
- MYSQL_PASSWORD=secret
|
- MYSQL_PASSWORD=secret
|
||||||
|
|||||||
@ -57,7 +57,7 @@ Don't forget to set:
|
|||||||
- `LETSENCRYPT_EMAIL` with a valid email
|
- `LETSENCRYPT_EMAIL` with a valid email
|
||||||
- `APP_URL` in your `.env` file with the right domain url
|
- `APP_URL` in your `.env` file with the right domain url
|
||||||
|
|
||||||
You may want to set `APP_ENV=production` to force the use of `https` mode.
|
You may want to set `APP_ENV=production` to force the use of `https` scheme.
|
||||||
|
|
||||||
This example add a `redis` container, that can be used too, adding these variables to your `.env` file:
|
This example add a `redis` container, that can be used too, adding these variables to your `.env` file:
|
||||||
- `REDIS_HOST=redis`: mandatory
|
- `REDIS_HOST=redis`: mandatory
|
||||||
|
|||||||
@ -16,7 +16,7 @@ services:
|
|||||||
db:
|
db:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=sekret_root_password
|
- MYSQL_RANDOM_ROOT_PASSWORD=true
|
||||||
- MYSQL_DATABASE=monica
|
- MYSQL_DATABASE=monica
|
||||||
- MYSQL_USER=homestead
|
- MYSQL_USER=homestead
|
||||||
- MYSQL_PASSWORD=secret
|
- MYSQL_PASSWORD=secret
|
||||||
|
|||||||
@ -25,7 +25,7 @@ services:
|
|||||||
db:
|
db:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=sekret_root_password
|
- MYSQL_RANDOM_ROOT_PASSWORD=true
|
||||||
- MYSQL_DATABASE=monica
|
- MYSQL_DATABASE=monica
|
||||||
- MYSQL_USER=homestead
|
- MYSQL_USER=homestead
|
||||||
- MYSQL_PASSWORD=secret
|
- MYSQL_PASSWORD=secret
|
||||||
|
|||||||
@ -25,7 +25,7 @@ services:
|
|||||||
db:
|
db:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=sekret_root_password
|
- MYSQL_RANDOM_ROOT_PASSWORD=true
|
||||||
- MYSQL_DATABASE=monica
|
- MYSQL_DATABASE=monica
|
||||||
- MYSQL_USER=homestead
|
- MYSQL_USER=homestead
|
||||||
- MYSQL_PASSWORD=secret
|
- MYSQL_PASSWORD=secret
|
||||||
|
|||||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -45,7 +45,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install bashbrew
|
- name: Install bashbrew
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL -o bashbrew https://doi-janky.infosiftr.net/job/bashbrew/lastSuccessfulBuild/artifact/bin/bashbrew-amd64
|
curl -fsSL -o bashbrew https://doi-janky.infosiftr.net/job/bashbrew/job/master/lastSuccessfulBuild/artifact/bashbrew-amd64
|
||||||
chmod +x "bashbrew"
|
chmod +x "bashbrew"
|
||||||
echo "::add-path::$(pwd)"
|
echo "::add-path::$(pwd)"
|
||||||
- name: Run stackbrew
|
- name: Run stackbrew
|
||||||
|
|||||||
78
README.md
78
README.md
@ -73,12 +73,13 @@ See some examples of docker-compose possibilities in the [example section](/.exa
|
|||||||
|
|
||||||
This version will use the apache image and add a mysql container. The volumes are set to keep your data persistent. This setup provides **no ssl encryption** and is intended to run behind a proxy.
|
This version will use the apache image and add a mysql container. The volumes are set to keep your data persistent. This setup provides **no ssl encryption** and is intended to run behind a proxy.
|
||||||
|
|
||||||
Make sure to pass in values for `APP_KEY` and `MYSQL_ROOT_PASSWORD` variables before you run this setup.
|
Make sure to pass in values for `APP_KEY` variable before you run this setup.
|
||||||
|
|
||||||
Set `APP_KEY` to a random 32-character string. For example, if you
|
Set `APP_KEY` to a random 32-character string. For example, if you
|
||||||
have the `pwgen` utility installed, you could copy and paste the
|
have the `pwgen` utility installed, you could copy and paste the
|
||||||
output of `pwgen -s 32 1`.
|
output of `pwgen -s 32 1`.
|
||||||
|
|
||||||
|
1. Create a `docker-compose.yml` file
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3.4"
|
version: "3.4"
|
||||||
@ -87,20 +88,20 @@ services:
|
|||||||
app:
|
app:
|
||||||
image: monica
|
image: monica
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- db
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 8080:80
|
||||||
environment:
|
environment:
|
||||||
- APP_KEY=
|
- APP_KEY=
|
||||||
- DB_HOST=mysql
|
- DB_HOST=db
|
||||||
volumes:
|
volumes:
|
||||||
- data:/var/www/html/storage
|
- data:/var/www/html/storage
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
mysql:
|
db:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=
|
- MYSQL_RANDOM_ROOT_PASSWORD=true
|
||||||
- MYSQL_DATABASE=monica
|
- MYSQL_DATABASE=monica
|
||||||
- MYSQL_USER=homestead
|
- MYSQL_USER=homestead
|
||||||
- MYSQL_PASSWORD=secret
|
- MYSQL_PASSWORD=secret
|
||||||
@ -115,14 +116,25 @@ volumes:
|
|||||||
name: mysql
|
name: mysql
|
||||||
```
|
```
|
||||||
|
|
||||||
Run `docker-compose up -d`.
|
2. Set a value for `APP_KEY` variable before you run this setup.
|
||||||
|
It should be a random 32-character string. For example, if you have the `pwgen` utility installed,
|
||||||
|
you can copy and paste the output of
|
||||||
|
```sh
|
||||||
|
pwgen -s 32 1
|
||||||
|
```
|
||||||
|
|
||||||
Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system. If this looks ok, add your first user account.
|
3. Run
|
||||||
|
```sh
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
Then run this command once:
|
Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system.
|
||||||
```sh
|
If this looks ok, add your first user account.
|
||||||
docker-compose exec app php artisan setup:production
|
|
||||||
```
|
4. Run this command once:
|
||||||
|
```sh
|
||||||
|
docker-compose exec app php artisan setup:production
|
||||||
|
```
|
||||||
|
|
||||||
### FPM version
|
### FPM version
|
||||||
|
|
||||||
@ -130,14 +142,12 @@ When using FPM image, you will need another container with a webserver to proxy
|
|||||||
|
|
||||||
The webserver will need an access to all static files from Monica container, the volumes `html` will deal with it.
|
The webserver will need an access to all static files from Monica container, the volumes `html` will deal with it.
|
||||||
|
|
||||||
An example of `nginx.conf` file can be found on the [`example section`](/.examples/supervisor/fpm/web/nginx.conf).
|
1. Download `nginx.conf` file. An example can be found on the [`example section`](/scripts/docker/.examples/supervisor/fpm/web/nginx.conf)
|
||||||
|
```sh
|
||||||
Make sure to set values for `APP_KEY` and `MYSQL_ROOT_PASSWORD` variables before you run this setup.
|
curl -sSL https://raw.githubusercontent.com/monicahq/monica/master/scripts/docker/.examples/supervisor/fpm/web/nginx.conf -o nginx.conf
|
||||||
|
```
|
||||||
Set `APP_KEY` to a random 32-character string. For example, if you
|
|
||||||
have the `pwgen` utility installed, you could copy and paste the
|
|
||||||
output of `pwgen -s 32 1`.
|
|
||||||
|
|
||||||
|
2. Create a `docker-compose.yml` file
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3.4"
|
version: "3.4"
|
||||||
@ -146,10 +156,10 @@ services:
|
|||||||
app:
|
app:
|
||||||
image: monica:fpm
|
image: monica:fpm
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- db
|
||||||
environment:
|
environment:
|
||||||
- APP_KEY=
|
- APP_KEY=
|
||||||
- DB_HOST=mysql
|
- DB_HOST=db
|
||||||
volumes:
|
volumes:
|
||||||
- html:/var/www/html
|
- html:/var/www/html
|
||||||
- data:/var/www/html/storage
|
- data:/var/www/html/storage
|
||||||
@ -167,10 +177,10 @@ services:
|
|||||||
- data:/var/www/html/storage:ro
|
- data:/var/www/html/storage:ro
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
mysql:
|
db:
|
||||||
image: mysql:5.7
|
image: mysql:5.7
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=
|
- MYSQL_RANDOM_ROOT_PASSWORD=true
|
||||||
- MYSQL_DATABASE=monica
|
- MYSQL_DATABASE=monica
|
||||||
- MYSQL_USER=homestead
|
- MYSQL_USER=homestead
|
||||||
- MYSQL_PASSWORD=secret
|
- MYSQL_PASSWORD=secret
|
||||||
@ -187,19 +197,29 @@ volumes:
|
|||||||
name: mysql
|
name: mysql
|
||||||
```
|
```
|
||||||
|
|
||||||
Run `docker-compose up -d`.
|
3. Set a value for `APP_KEY` variable before you run this setup.
|
||||||
|
It should be a random 32-character string. For example, if you have the `pwgen` utility installed,
|
||||||
|
you can copy and paste the output of
|
||||||
|
```sh
|
||||||
|
pwgen -s 32 1
|
||||||
|
```
|
||||||
|
|
||||||
Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system. If this looks ok, add your first user account.
|
4. Run
|
||||||
|
```sh
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
Then run this command once:
|
Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system.
|
||||||
```sh
|
If this looks ok, add your first user account.
|
||||||
docker-compose exec app php artisan setup:production
|
|
||||||
```
|
|
||||||
|
|
||||||
|
5. Run this command once:
|
||||||
|
```sh
|
||||||
|
docker-compose exec app php artisan setup:production
|
||||||
|
```
|
||||||
|
|
||||||
## Make Monica available from the internet
|
## Make Monica available from the internet
|
||||||
|
|
||||||
To expose your Monica instance for the internet, it's important to set `APP_ENV=production` in your `.env` file. In this case `https` mode will be mandatory.
|
To expose your Monica instance for the internet, it's important to set `APP_ENV=production` in your `.env` file or environment variables. In this case `https` scheme will be **mandatory**.
|
||||||
|
|
||||||
### Using a proxy webserver on the host
|
### Using a proxy webserver on the host
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ RUN set -ex; \
|
|||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.18; \
|
pecl install APCu-5.1.18; \
|
||||||
pecl install memcached-3.1.5; \
|
pecl install memcached-3.1.5; \
|
||||||
pecl install redis-5.2.1; \
|
pecl install redis-5.2.2; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
|||||||
@ -65,7 +65,7 @@ RUN set -ex; \
|
|||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.18; \
|
pecl install APCu-5.1.18; \
|
||||||
pecl install memcached-3.1.5; \
|
pecl install memcached-3.1.5; \
|
||||||
pecl install redis-5.2.1; \
|
pecl install redis-5.2.2; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
|||||||
@ -66,7 +66,7 @@ RUN set -ex; \
|
|||||||
# pecl will claim success even if one install fails, so we need to perform each install separately
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
||||||
pecl install APCu-5.1.18; \
|
pecl install APCu-5.1.18; \
|
||||||
pecl install memcached-3.1.5; \
|
pecl install memcached-3.1.5; \
|
||||||
pecl install redis-5.2.1; \
|
pecl install redis-5.2.2; \
|
||||||
\
|
\
|
||||||
docker-php-ext-enable \
|
docker-php-ext-enable \
|
||||||
apcu \
|
apcu \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user