summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Dockerfile-proxy2
-rw-r--r--README.md13
-rw-r--r--contrib/Dockerfile (renamed from Dockerfile)0
-rw-r--r--contrib/docker-compose.yml (renamed from docker-compose.yml)24
-rw-r--r--contrib/nginx/Dockerfile2
-rw-r--r--contrib/nginx/nginx.conf (renamed from nginx.conf)0
6 files changed, 31 insertions, 10 deletions
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
index a45633f5..a45633f5 100644
--- a/Dockerfile
+++ b/contrib/Dockerfile
diff --git a/docker-compose.yml b/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
index bbaf5824..bbaf5824 100644
--- a/nginx.conf
+++ b/contrib/nginx/nginx.conf