This commit is contained in:
Alexis Saettler 2020-07-05 14:29:49 +02:00
parent 6a521436c4
commit 053b629fef
No known key found for this signature in database
GPG Key ID: E0E7B3254E8E4407
1 changed files with 111 additions and 116 deletions

View File

@ -16,7 +16,7 @@ The `fpm` tag contains a fastCGI-Process that serves the web pages. This image s
This image contains a webserver that exposes port 80. Run the container with: This image contains a webserver that exposes port 80. Run the container with:
```sh ```console
docker run --name some-%%REPO%% -d -p 80:80 %%IMAGE%% docker run --name some-%%REPO%% -d -p 80:80 %%IMAGE%%
``` ```
@ -24,7 +24,7 @@ docker run --name some-%%REPO%% -d -p 80:80 %%IMAGE%%
This image serves a fastCGI server that exposes port 9000. You may need an additional web server that can proxy requests to the fpm port 9000 of the container. Run this container with: This image serves a fastCGI server that exposes port 9000. You may need an additional web server that can proxy requests to the fpm port 9000 of the container. Run this container with:
```sh ```console
docker run --name some-%%REPO%% -d -p 9000:9000 %%IMAGE%%:fpm docker run --name some-%%REPO%% -d -p 9000:9000 %%IMAGE%%:fpm
``` ```
@ -34,9 +34,9 @@ To have a persistent storage for your datas, you may want to create volumes for
Run a container with this named volume: Run a container with this named volume:
```sh ```console
docker run -d docker run -d \
-v monica_data:/var/www/html/storage -v monica_data:/var/www/html/storage \
%%IMAGE%% %%IMAGE%%
``` ```
@ -44,13 +44,13 @@ docker run -d
Like every Laravel application, the `php artisan` command is very usefull for Monica. To run a command inside the container, run Like every Laravel application, the `php artisan` command is very usefull for Monica. To run a command inside the container, run
```sh ```console
docker exec CONTAINER_ID php artisan COMMAND docker exec CONTAINER_ID php artisan COMMAND
``` ```
or for docker-compose or for docker-compose
```sh ```console
docker-compose exec %%REPO%% php artisan COMMAND docker-compose exec %%REPO%% php artisan COMMAND
``` ```
@ -68,16 +68,12 @@ This version will use the apache image and add a mysql container. The volumes ar
Make sure to pass in values for `APP_KEY` variable 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 1. Create a `docker-compose.yml` file
```yaml ```yaml
version: "3.4" version: "3.4"
services: services:
app: app:
image: monica image: monica
depends_on: depends_on:
@ -102,30 +98,30 @@ services:
- mysql:/var/lib/mysql - mysql:/var/lib/mysql
restart: always restart: always
volumes: volumes:
data: data:
name: data name: data
mysql: mysql:
name: mysql name: mysql
``` ```
2. Set a value for `APP_KEY` variable before you run this setup. 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:
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 ```console
```sh
pwgen -s 32 1 pwgen -s 32 1
``` ```
3. Run 3. Run
```sh
```console
docker-compose up -d docker-compose up -d
``` ```
Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system. 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.
If this looks ok, add your first user account.
4. Run this command once: 4. Run this command once:
```sh
```console
docker-compose exec app php artisan setup:production docker-compose exec app php artisan setup:production
``` ```
@ -133,15 +129,14 @@ volumes:
When using FPM image, you will need another container with a webserver to proxy http requests. In this example we use nginx with a basic container to do this. When using FPM image, you will need another container with a webserver to proxy http requests. In this example we use nginx with a basic container to do this.
1. Download `nginx.conf` and `Dockerfile` file for nginx image. An example can be found on the [`example section`](%%GITHUB-REPO%%/blob/master/.examples/supervisor/fpm/web/). 1. Download `nginx.conf` and `Dockerfile` file for nginx image. An example can be found on the [`example section`](%%GITHUB-REPO%%/blob/master/.examples/supervisor/fpm/web/). The `web` container image should be pre-build before each deploy with: `docker-compose build`
The `web` container image should be pre-build before each deploy with: `docker-compose build`
2. Create a `docker-compose.yml` file 2. Create a `docker-compose.yml` file
```yaml ```yaml
version: "3.4" version: "3.4"
services: services:
app: app:
image: monica:fpm image: monica:fpm
depends_on: depends_on:
@ -174,30 +169,30 @@ services:
- mysql:/var/lib/mysql - mysql:/var/lib/mysql
restart: always restart: always
volumes: volumes:
data: data:
name: data name: data
mysql: mysql:
name: mysql name: mysql
``` ```
3. Set a value for `APP_KEY` variable before you run this setup. 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:
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 ```console
```sh
pwgen -s 32 1 pwgen -s 32 1
``` ```
4. Run 4. Run
```sh
```console
docker-compose up -d docker-compose up -d
``` ```
Wait until all migrations are done and then access Monica at http://localhost:8080/ from your host system. 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.
If this looks ok, add your first user account.
5. Run this command once: 5. Run this command once:
```sh
```console
docker-compose exec app php artisan setup:production docker-compose exec app php artisan setup:production
``` ```