From 8ed3ed3a77a46997e5afa8915bb9ee77c8caf249 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 12 Aug 2018 16:23:35 +0200 Subject: [PATCH] Moved docker files to contrib, added documentation --- Dockerfile-proxy | 2 -- README.md | 13 ++++++++++ Dockerfile => contrib/Dockerfile | 0 .../docker-compose.yml | 24 ++++++++++++------- contrib/nginx/Dockerfile | 2 ++ nginx.conf => contrib/nginx/nginx.conf | 0 6 files changed, 31 insertions(+), 10 deletions(-) delete mode 100644 Dockerfile-proxy rename Dockerfile => contrib/Dockerfile (100%) rename docker-compose.yml => contrib/docker-compose.yml (65%) create mode 100644 contrib/nginx/Dockerfile rename nginx.conf => contrib/nginx/nginx.conf (100%) diff --git a/Dockerfile-proxy b/Dockerfile-proxy deleted file mode 100644 index b846f218..00000000 --- a/Dockerfile-proxy +++ /dev/null @@ -1,2 +0,0 @@ -FROM nginx:alpine -COPY nginx.conf /etc/nginx/nginx.conf diff --git a/README.md b/README.md index 248adff0..158fa8c1 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/Dockerfile b/contrib/Dockerfile similarity index 100% rename from Dockerfile rename to contrib/Dockerfile diff --git a/docker-compose.yml b/contrib/docker-compose.yml similarity index 65% rename from docker-compose.yml rename to contrib/docker-compose.yml index de18805e..9048fb49 100644 --- a/docker-compose.yml +++ b/contrib/docker-compose.yml @@ -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 @@ -33,5 +41,5 @@ services: # ports: # - 8080:8080 volumes: - db: {} - static: {} \ No newline at end of file + db: {} + static: {} diff --git a/contrib/nginx/Dockerfile b/contrib/nginx/Dockerfile new file mode 100644 index 00000000..a06ea3e7 --- /dev/null +++ b/contrib/nginx/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:alpine +COPY contrib/nginx/nginx.conf /etc/nginx/nginx.conf diff --git a/nginx.conf b/contrib/nginx/nginx.conf similarity index 100% rename from nginx.conf rename to contrib/nginx/nginx.conf