Update doc and examples (#8)

This commit is contained in:
Alexis Saettler 2020-05-10 15:40:36 +02:00 committed by GitHub
parent 4458723f48
commit c71fae6632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 59 additions and 39 deletions

View File

@ -35,7 +35,7 @@ services:
db:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=sekret_root_password
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret

View File

@ -34,7 +34,7 @@ services:
db:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=sekret_root_password
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret

View File

@ -57,7 +57,7 @@ Don't forget to set:
- `LETSENCRYPT_EMAIL` with a valid email
- `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:
- `REDIS_HOST=redis`: mandatory

View File

@ -16,7 +16,7 @@ services:
db:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=sekret_root_password
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret

View File

@ -25,7 +25,7 @@ services:
db:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=sekret_root_password
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret

View File

@ -25,7 +25,7 @@ services:
db:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=sekret_root_password
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret

View File

@ -45,7 +45,7 @@ jobs:
- name: Install bashbrew
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"
echo "::add-path::$(pwd)"
- name: Run stackbrew

View File

@ -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.
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
have the `pwgen` utility installed, you could copy and paste the
output of `pwgen -s 32 1`.
1. Create a `docker-compose.yml` file
```yaml
version: "3.4"
@ -87,20 +88,20 @@ services:
app:
image: monica
depends_on:
- mysql
- db
ports:
- 8080:80
environment:
- APP_KEY=
- DB_HOST=mysql
- DB_HOST=db
volumes:
- data:/var/www/html/storage
restart: always
mysql:
db:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret
@ -115,11 +116,22 @@ volumes:
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.
If this looks ok, add your first user account.
4. Run this command once:
```sh
docker-compose exec app php artisan setup:production
```
@ -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.
An example of `nginx.conf` file can be found on the [`example section`](/.examples/supervisor/fpm/web/nginx.conf).
Make sure to set values for `APP_KEY` and `MYSQL_ROOT_PASSWORD` variables before you run this setup.
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`.
1. Download `nginx.conf` file. An example can be found on the [`example section`](/scripts/docker/.examples/supervisor/fpm/web/nginx.conf)
```sh
curl -sSL https://raw.githubusercontent.com/monicahq/monica/master/scripts/docker/.examples/supervisor/fpm/web/nginx.conf -o nginx.conf
```
2. Create a `docker-compose.yml` file
```yaml
version: "3.4"
@ -146,10 +156,10 @@ services:
app:
image: monica:fpm
depends_on:
- mysql
- db
environment:
- APP_KEY=
- DB_HOST=mysql
- DB_HOST=db
volumes:
- html:/var/www/html
- data:/var/www/html/storage
@ -167,10 +177,10 @@ services:
- data:/var/www/html/storage:ro
restart: always
mysql:
db:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret
@ -187,19 +197,29 @@ volumes:
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.
If this looks ok, add your first user account.
5. Run this command once:
```sh
docker-compose exec app php artisan setup:production
```
## 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

View File

@ -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 install APCu-5.1.18; \
pecl install memcached-3.1.5; \
pecl install redis-5.2.1; \
pecl install redis-5.2.2; \
\
docker-php-ext-enable \
apcu \

View File

@ -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 install APCu-5.1.18; \
pecl install memcached-3.1.5; \
pecl install redis-5.2.1; \
pecl install redis-5.2.2; \
\
docker-php-ext-enable \
apcu \

View File

@ -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 install APCu-5.1.18; \
pecl install memcached-3.1.5; \
pecl install redis-5.2.1; \
pecl install redis-5.2.2; \
\
docker-php-ext-enable \
apcu \