Skip to content

Commit

Permalink
chore(ci): docker compose (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored May 3, 2024
1 parent d9de7b0 commit d6ee8f4
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: '3.9'

x-common: &common
depends_on: ["backend"]
environment:
VITE_BACKEND_URL: http://backend:5000
VITE_ZONE: DEV
healthcheck:
test: wget --no-verbose --spider http://localhost:3000
interval: 15s
retries: 5
timeout: 5s
start_period: 10s
restart: always

services:
backend:
container_name: backend
entrypoint: sh -c "npm ci && npm run start"
environment:
CHES_CLIENT_ID : 09C5071A-ACE9B6FACF6
CHES_TOKEN_URL : https://test.loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token
healthcheck:
test: timeout 10s bash -c 'true > /dev/tcp/127.0.0.1/5000'
interval: 15s
retries: 5
start_period: 10s
timeout: 5s
image: node:20.12.2-bullseye-slim
ports: ["5000:5000"]
restart: always
volumes: ["./backend:/app", "/app/node_modules"]
working_dir: "/app"

frontend:
container_name: frontend
profiles: [dev, frontend]
entrypoint: sh -c "npm ci && npm run start"
image: node:20-bullseye
ports: ["3000:3000"]
volumes: ["./frontend:/app", "/app/node_modules"]
working_dir: "/app"
<<: *common

caddy:
container_name: caddy
profiles: [caddy]
build: ./frontend
ports: ["3000:3000"]
volumes: ["./frontend/Caddyfile:/etc/caddy/Caddyfile"]
<<: *common

0 comments on commit d6ee8f4

Please sign in to comment.