Docker Library Bot 4 лет назад
Родитель
Сommit
8d4a5dba3e
1 измененных файлов с 27 добавлено и 15 удалено
  1. 27 15
      monica/README.md

+ 27 - 15
monica/README.md

@@ -53,7 +53,7 @@ Monica is a great open source personal relationship management system to organiz
 
 
 ![logo](https://raw.githubusercontent.com/docker-library/docs/b962028212dbd77c9531dbcf8d5a81db79d4a735/monica/logo.svg?sanitize=true)
 ![logo](https://raw.githubusercontent.com/docker-library/docs/b962028212dbd77c9531dbcf8d5a81db79d4a735/monica/logo.svg?sanitize=true)
 
 
-# How to use this image
+## How to use this image
 
 
 There are two versions of the image you may choose from.
 There are two versions of the image you may choose from.
 
 
@@ -66,7 +66,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:
 
 
 ```console
 ```console
-docker run --name some-monica -d -p 80:80 monica
+docker run --name some-monica -d -p 8080:80 monica
 ```
 ```
 
 
 ### Using the fpm image
 ### Using the fpm image
@@ -77,6 +77,10 @@ This image serves a fastCGI server that exposes port 9000. You may need an addit
 docker run --name some-monica -d -p 9000:9000 monica:fpm
 docker run --name some-monica -d -p 9000:9000 monica:fpm
 ```
 ```
 
 
+### Using an external database
+
+You'll need to setup an external database. Monica currently support MySQL/MariaDB database. You can also link a database container, e. g. `--link my-mysql:db`, and then use `db` as the database host on setup. More info is in the docker-compose section.
+
 ### Persistent data storage
 ### Persistent data storage
 
 
 To have a persistent storage for your datas, you may want to create volumes for your db, and for monica you will have to save the `/var/www/html/storage` directory.
 To have a persistent storage for your datas, you may want to create volumes for your db, and for monica you will have to save the `/var/www/html/storage` directory.
@@ -105,6 +109,10 @@ docker-compose exec monica php artisan COMMAND
 
 
 where `monica` is the name of the service in your `docker-compose.yml` file.
 where `monica` is the name of the service in your `docker-compose.yml` file.
 
 
+## Configuration using environment variables
+
+The Monica image will use environment variables to setup the application. See [Monica documentation](https://github.com/monicahq/monica/blob/master/.env.example) for common used variables you should setup.
+
 ## Running the image with docker-compose
 ## Running the image with docker-compose
 
 
 See some examples of docker-compose possibilities in the [example section](https://github.com/monicahq/docker/blob/master/.examples).
 See some examples of docker-compose possibilities in the [example section](https://github.com/monicahq/docker/blob/master/.examples).
@@ -132,6 +140,8 @@ Make sure to pass in values for `APP_KEY` variable before you run this setup.
 	    environment:
 	    environment:
 	      - APP_KEY=
 	      - APP_KEY=
 	      - DB_HOST=db
 	      - DB_HOST=db
+	      - DB_USERNAME=monica
+	      - DB_PASSWORD=secret
 	    volumes:
 	    volumes:
 	      - data:/var/www/html/storage
 	      - data:/var/www/html/storage
 	    restart: always
 	    restart: always
@@ -141,7 +151,7 @@ Make sure to pass in values for `APP_KEY` variable before you run this setup.
 	    environment:
 	    environment:
 	      - MYSQL_RANDOM_ROOT_PASSWORD=true
 	      - MYSQL_RANDOM_ROOT_PASSWORD=true
 	      - MYSQL_DATABASE=monica
 	      - MYSQL_DATABASE=monica
-	      - MYSQL_USER=homestead
+	      - MYSQL_USER=monica
 	      - MYSQL_PASSWORD=secret
 	      - MYSQL_PASSWORD=secret
 	    volumes:
 	    volumes:
 	      - mysql:/var/lib/mysql
 	      - mysql:/var/lib/mysql
@@ -154,11 +164,7 @@ Make sure to pass in values for `APP_KEY` variable before you run this setup.
 	    name: mysql
 	    name: mysql
 	```
 	```
 
 
-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:
-
-	```console
-	pwgen -s 32 1
-	```
+2.	Set a value for `APP_KEY` variable before you run this setup. It should be a random 32-character string. You can for instance copy and paste the output of `echo -n 'base64:'; openssl rand -base64 32`:
 
 
 3.	Run
 3.	Run
 
 
@@ -178,7 +184,15 @@ Make sure to pass in values for `APP_KEY` variable before you run this setup.
 
 
 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`](https://github.com/monicahq/docker/blob/master/.examples/supervisor/fpm/web/). The `web` container image should be pre-build before each deploy with: `docker-compose build`
+1.	Download `nginx.conf` and `Dockerfile` file for nginx image. An example can be found on the [`example section`](https://github.com/monicahq/docker/blob/master/.examples/supervisor/fpm/web/)
+
+	```sh
+	mkdir web
+	curl -sSL https://raw.githubusercontent.com/monicahq/docker/master/.examples/nginx-proxy/web/nginx.conf -o web/nginx.conf
+	curl -sSL https://raw.githubusercontent.com/monicahq/docker/master/.examples/nginx-proxy/web/Dockerfile -o web/Dockerfile
+	```
+
+	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
 
 
@@ -193,6 +207,8 @@ When using FPM image, you will need another container with a webserver to proxy
 	    environment:
 	    environment:
 	      - APP_KEY=
 	      - APP_KEY=
 	      - DB_HOST=db
 	      - DB_HOST=db
+	      - DB_USERNAME=monica
+	      - DB_PASSWORD=secret
 	    volumes:
 	    volumes:
 	      - data:/var/www/html/storage
 	      - data:/var/www/html/storage
 	    restart: always
 	    restart: always
@@ -212,7 +228,7 @@ When using FPM image, you will need another container with a webserver to proxy
 	    environment:
 	    environment:
 	      - MYSQL_RANDOM_ROOT_PASSWORD=true
 	      - MYSQL_RANDOM_ROOT_PASSWORD=true
 	      - MYSQL_DATABASE=monica
 	      - MYSQL_DATABASE=monica
-	      - MYSQL_USER=homestead
+	      - MYSQL_USER=monica
 	      - MYSQL_PASSWORD=secret
 	      - MYSQL_PASSWORD=secret
 	    volumes:
 	    volumes:
 	      - mysql:/var/lib/mysql
 	      - mysql:/var/lib/mysql
@@ -225,11 +241,7 @@ When using FPM image, you will need another container with a webserver to proxy
 	    name: mysql
 	    name: mysql
 	```
 	```
 
 
-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:
-
-	```console
-	pwgen -s 32 1
-	```
+3.	Set a value for `APP_KEY` variable before you run this setup. It should be a random 32-character string. You can for instance copy and paste the output of `echo -n 'base64:'; openssl rand -base64 32`:
 
 
 4.	Run
 4.	Run