Moved docker files to contrib, added documentation

This commit is contained in:
Igor Scheller 2018-08-12 16:23:35 +02:00 committed by msquare
parent d7ba51b3ec
commit 8ed3ed3a77
6 changed files with 31 additions and 10 deletions

View File

@ -1,2 +0,0 @@
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf

View File

@ -82,6 +82,19 @@ PRODUCTION_REMOTE # Same as STAGING_REMOTE but for the production environm
PRODUCTION_REMOTE_PATH # Same as STAGING_REMOTE_PATH but for the production environment
```
### Docker container
To build the `engelsystem` and the `engelsystem-nginx` container:
```bash
cd contrib
docker-compose build
```
or to build the containers separately
```bash
docker build -f contrib/Dockerfile . -t engelsystem
docker build -f contrib/nginx/Dockerfile . -t engelsystem-nginx
```
#### deploy.sh
The `deploy.sh` script can be used to deploy the engelsystem. It uses rsync to deploy the application to a server over ssh.

View File

@ -1,23 +1,31 @@
version: "3.3"
version: "3.6"
services:
nginx:
image: engelsystem-nginx
build:
context: .
dockerfile: Dockerfile-proxy
context: ..
dockerfile: contrib/nginx/Dockerfile
ports:
- 5000:80
volumes:
- static:/var/www/html
depends_on:
- engelsystem
engelsystem:
build: ./
image: engelsystem
build:
context: ..
dockerfile: contrib/Dockerfile
environment:
MYSQL_HOST: db
MYSQL_HOST: database
MYSQL_USER: engelsystem
MYSQL_PASSWORD: engelsystem
MYSQL_DATABASE: engelsystem
volumes:
- static:/var/www/html
db:
depends_on:
- database
database:
image: mariadb:latest
environment:
MYSQL_DATABASE: engelsystem

2
contrib/nginx/Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM nginx:alpine
COPY contrib/nginx/nginx.conf /etc/nginx/nginx.conf