Commit 46bccbcc authored by Jacob Priddy's avatar Jacob Priddy 👌

run docker in swarm mode

parent 89ab1379
Pipeline #13210 canceled with stages
in 1 minute and 21 seconds
......@@ -90,27 +90,25 @@ deploy application:
- elock
stage: deploy
script:
- echo $POSTGRES_PASSWORD
- ls /builds/elock/doorcode.tmp
# # Delete previous unneeded artifacts
# - >
# rm -rf src/backend/cov
# src/backend/vendor
# src/backend/tests
# src/frontend
# src/install-dev.sh
# src/backend/node_modules
# - docker-compose -f docker-compose.prod.yml build
# - docker build -t $DOORCODE_IMAGE_NAME -f prod.Dockerfile .
# - docker build -t $NGINX_IMAGE_NAME -f nginx.Dockerfile .
# - docker-compose -f docker-compose.prod.yml down
# - sed -i "s/\(^DB_PASSWORD=\).*/\1$(cat $POSTGRES_PASSWORD)/" $PROJ_DIR/.env
# - docker-compose -f docker-compose.prod.yml up -d
# # Give it some time to spin up...
# - sleep 10
# # Make sure app is running
# - "curl --fail --insecure --location https://${DEPLOY_ADDRESS}/api"
# - "curl --fail --insecure --location https://${DEPLOY_ADDRESS}/api/docs"
# Delete previous unneeded artifacts
- >
rm -rf src/backend/cov
src/backend/vendor
src/backend/tests
src/frontend
src/install-dev.sh
src/backend/node_modules
- docker-compose -f docker-compose.prod.yml build
- docker build -t $DOORCODE_IMAGE_NAME -f prod.Dockerfile .
- docker build -t $NGINX_IMAGE_NAME -f nginx.Dockerfile .
- docker-compose -f docker-compose.prod.yml down
- sed -i "s/\(^DB_PASSWORD=\).*/\1$(cat $POSTGRES_PASSWORD)/" $PROJ_DIR/.env
- docker-compose -f docker-compose.prod.yml up -d
# Give it some time to spin up...
- sleep 10
# Make sure app is running
- "curl --fail --insecure --location https://${DEPLOY_ADDRESS}/api"
- "curl --fail --insecure --location https://${DEPLOY_ADDRESS}/api/docs"
- exit 1
environment:
name: production
......
......@@ -2,7 +2,7 @@ version: '3.8'
networks:
doorcode:
driver: bridge
attachable: true
secrets:
webserver_cert:
......@@ -27,7 +27,6 @@ volumes:
services:
webserver:
image: $NGINX_IMAGE_NAME
restart: always
secrets:
- webserver_cert
- webserver_key
......@@ -36,16 +35,19 @@ services:
- wwu_webserver_key
- wwu_root_cert
ports:
- "4433:4433"
- "443:443"
- "80:80"
- target: "4433"
published: "4433"
mode: host
- target: "443"
published: "443"
mode: host
- target: "80"
published: "80"
mode: host
volumes:
- $PROJ_DIR/simple-saml/cert:/var/simplesamlphp/cert:ro
- $PROJ_DIR/simple-saml/config:/var/simplesamlphp/config:ro
- $PROJ_DIR/simple-saml/metadata:/var/simplesamlphp/metadata
depends_on:
- dbadmin
- api
logging:
options:
max-size: "10m"
......@@ -54,11 +56,12 @@ services:
- doorcode
postgres:
image: postgres:13-alpine
restart: always
secrets:
- postgres_password
ports:
- "127.0.0.1:5432:5432"
- target: "5432"
published: "127.0.0.1:5432"
mode: host
volumes:
- db-data:/var/lib/postgresql/data
environment:
......@@ -73,9 +76,6 @@ services:
- doorcode
dbadmin:
image: dpage/pgadmin4:4.24
restart: always
depends_on:
- postgres
volumes:
- pgadmin-data:/var/lib/pgadmin
environment:
......@@ -89,7 +89,6 @@ services:
- doorcode
api:
image: $DOORCODE_IMAGE_NAME
restart: always
volumes:
- $PROJ_DIR/.env:/var/www/backend/.env:ro
- $PROJ_DIR/controller-bins:/var/www/backend/storage/app/controller/binaries:ro
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment