Skip to content

Commit

Permalink
build(vth): add prod docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
bddjong committed Aug 22, 2023
1 parent fb6a24c commit 8beacd0
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ COPY ./package.json ./yarn.lock ./
ENV PATH /opt/app/node_modules/.bin:$PATH
COPY ./apps/pdc-frontend/package.json apps/pdc-frontend/package.json
COPY ./apps/pdc-dashboard/package.json apps/pdc-dashboard/package.json
COPY ./apps/vth-dashboard/package.json apps/vth-dashboard/package.json
COPY ./packages/catalogi-data/package.json packages/catalogi-data/package.json
COPY ./packages/preview-button/package.json packages/preview-button/package.json
COPY ./packages/samenwerkende-catalogi/package.json packages/samenwerkende-catalogi/package.json
Expand Down
79 changes: 79 additions & 0 deletions docker-compose.vth.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
version: "3.8"
services:
vth_strapi:
container_name: vth_strapi
build:
context: .
dockerfile: Dockerfile.prod
image: vth-strapi:latest
restart: unless-stopped
volumes:
- ./apps/vth-dashboard/public/uploads:/opt/app/apps/vth-dashboard/public/uploads
command: npm run --workspace @frameless/vth-dashboard start
environment:
HOST: ${HOST}
PORT: ${PORT}
APP_KEYS: ${APP_KEYS}
ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET}
JWT_SECRET: ${JWT_SECRET}
API_TOKEN_SALT: ${API_TOKEN_SALT}
PREVIEW_SECRET_TOKEN: ${PREVIEW_SECRET_TOKEN}
TRANSFER_TOKEN_SALT: ${TRANSFER_TOKEN_SALT}
FRONTEND_PUBLIC_URL: ${FRONTEND_PUBLIC_URL}
DATABASE_CLIENT: ${DATABASE_CLIENT}
DATABASE_HOST: vth_strapi_db
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
NODE_ENV: ${NODE_ENV}
ports:
- "1337:1337"
networks:
- vth_strapi_network
depends_on:
- vth_strapi_db
vth_strapi_db:
container_name: vth_strapi_db
platform: linux/amd64 #for platform error on Apple M1 chips
restart: unless-stopped
image: postgres:12.0-alpine
environment:
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}
healthcheck:
test:
[
"CMD-SHELL",
"sh -c 'pg_isready -U ${DATABASE_USERNAME} -d ${DATABASE_NAME}'",
]
interval: 10s
timeout: 3s
retries: 3
volumes:
- vth-strapi-data:/var/lib/postgresql/data/
ports:
- "5432:5432"
networks:
- vth_strapi_network
vth_pgadmin:
container_name: vth_pgadmin
image: dpage/pgadmin4
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
ports:
- "9000:80"
networks:
- vth_strapi_network
depends_on:
- vth_strapi_db
volumes:
vth-strapi-data:

networks:
vth_strapi_network:
name: Strapi network
driver: bridge

0 comments on commit 8beacd0

Please sign in to comment.