Commit c001d21d authored by Jacob Priddy's avatar Jacob Priddy 👌

Give iamge to copy source from to nginx

parent d9f6ca73
Pipeline #13212 failed with stages
in 2 minutes and 39 seconds
......@@ -100,7 +100,7 @@ deploy application:
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 build --build-arg APP_IMAGE=$DOORCODE_IMAGE_NAME -t $NGINX_IMAGE_NAME -f nginx.Dockerfile .
- sed -i "s/\(^DB_PASSWORD=\).*/\1$(cat $POSTGRES_PASSWORD)/" $PROJ_DIR/.env
- docker stack deploy -c docker-compose.prod.yml doorcode --prune
# Give it some time to spin up...
......
......@@ -33,7 +33,7 @@ secrets:
file: $POSTGRES_PASSWORD
volumes:
doorcode_db-data:
doorcode_db:
external: true
doorcode_pgadmin-data:
external: true
......@@ -86,7 +86,7 @@ services:
secrets:
- postgres_password
volumes:
- doorcode_db-data:/var/lib/postgresql/data
- doorcode_db:/var/lib/postgresql/data
environment:
POSTGRES_USER: web
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
......
version: '3.7'
networks:
doorcode:
driver: bridge
secrets:
webserver_cert:
file: ./secrets/certs/webserver.cert
webserver_key:
file: ./secrets/certs/webserver.key
root_cert:
file: ./secrets/certs/root.cert
volumes:
db-data:
pgadmin-data:
services:
webserver:
image: nginx:1-alpine
container_name: webserver
restart: unless-stopped
tty: true
secrets:
- webserver_cert
- webserver_key
- root_cert
ports:
- "8080:443"
volumes:
- ./src:/var/www
- ./nginx/conf.d/app.conf:/etc/nginx/conf.d/app.conf
- ./nginx/dhparam/:/run/dhparam
# Saml config
- ./simplesamlphp-1.19.0-rc1:/var/simplesamlphp
- ./simple-saml/cert:/var/simplesamlphp/cert
- ./simple-saml/config:/var/simplesamlphp/config
- ./simple-saml/metadata:/var/simplesamlphp/metadata
- ./simplesamlphp-1.19.0-rc1:/var/simplesamlphp-idp
- ./simple-saml-idp/cert:/var/simplesamlphp-idp/cert
- ./simple-saml-idp/config:/var/simplesamlphp-idp/config
- ./simple-saml-idp/metadata:/var/simplesamlphp-idp/metadata
depends_on:
- dbadmin
- api
logging:
options:
max-size: "10m"
max-file: "3"
networks:
- doorcode
postgres:
image: postgres:13-alpine
container_name: postgres
restart: unless-stopped
tty: true
ports:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: web
POSTGRES_PASSWORD: secret
POSTGRES_DB: doorcode
logging:
options:
max-size: "10m"
max-file: "3"
networks:
- doorcode
dbadmin:
image: dpage/pgadmin4:latest
container_name: dbadmin
restart: unless-stopped
tty: true
ports:
- "8081:80"
depends_on:
- postgres
volumes:
- pgadmin-data:/var/lib/pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@elock
PGADMIN_DEFAULT_PASSWORD: secret
logging:
options:
max-size: "10m"
max-file: "3"
networks:
- doorcode
api:
build:
context: .
dockerfile: Dockerfile
container_name: api
environment:
XDEBUG_MODE: debug
volumes:
- ./src:/var/www
- ./php/dev.ini:/usr/local/etc/php/conf.d/local.ini
# Map saml files to the php-fpm server so it has access to them as well
- ./simplesamlphp-1.19.0-rc1:/var/simplesamlphp
- ./simple-saml/cert:/var/simplesamlphp/cert
- ./simple-saml/config:/var/simplesamlphp/config
- ./simple-saml/metadata:/var/simplesamlphp/metadata
- ./simplesamlphp-1.19.0-rc1:/var/simplesamlphp-idp
- ./simple-saml-idp/cert:/var/simplesamlphp-idp/cert
- ./simple-saml-idp/config:/var/simplesamlphp-idp/config
- ./simple-saml-idp/metadata:/var/simplesamlphp-idp/metadata
ports:
# For xdebug
- "9003:9003"
logging:
options:
max-size: "10m"
max-file: "3"
networks:
- doorcode
FROM nginx:1.19.5-alpine
ARG APP_IMAGE=''
WORKDIR /var/www
COPY --from=doorcode/app:master /var/www ${WORKDIR}
COPY --from=$APP_IMAGE /var/www ${WORKDIR}
COPY simplesamlphp-1.19.0-rc1/ ../simplesamlphp
COPY nginx/conf.d/prod.conf /etc/nginx/conf.d/prod.conf
COPY nginx/dhparam/ /run/dhparam
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