-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathdocker-compose.yml
92 lines (92 loc) · 3.41 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
services:
# Postgresql database
db:
build:
context: backend/db-setup
image: ghcr.io/cdcgov/prime-simplereport/database:${DOCKER_DATABASE_IMAGE_VERSION:-latest}
container_name: "${DB_NAME:-db}"
environment:
POSTGRES_PASSWORD: admin_password_for_local_dev_is_not_very_secure
SNAPSHOT: /usr/local/lib/anon_dump.sql
volumes:
# Create/use a named volume so that the database is not wiped if we recreate the container
- db-data:/var/lib/postgresql/data
# Mount init scripts for first-run user/schema creation
- ./backend/db-setup/create-db.sh:/docker-entrypoint-initdb.d/01-user-db-creation.sh
- ./backend/db-setup/create-metabase-db.sh:/docker-entrypoint-initdb.d/02-metabase-db-creation.sh
- ./backend/db-setup/reset-db.sql:/usr/local/lib/reset-db.sql
- ./backend/db-setup/anonymize-detect.sh:/usr/local/lib/anonymize-detect.sh
- ./backend/db-setup/remove-anon.sh:/usr/local/lib/remove-anon.sh
- ./backend/db-setup/anonymize-db.sql:/usr/local/lib/anonymize-db.sql
- ./backend/db-setup/reset-metabase-db.sql:/usr/local/lib/reset-metabase-db.sql
- ./backend/db-setup/restore-db.sh:/usr/local/lib/restore-db.sh
- ./backend/db-setup/nuke-db.sh:/usr/local/lib/nuke-db.sh
- ./backend/db-setup/snapshot-db.sh:/usr/local/lib/snapshot-db.sh
- ./backend/db-setup/.pgpass/:/usr/local/lib/.pgpass
- ./backend/db-setup/snapshots/:/usr/local/lib/snapshots/
- ./backend/db-setup/generate_db_data.py:/usr/local/lib/generate_db_data.py
command: -p ${SR_DB_PORT:-5432} -c log_statement=all
expose:
- "${SR_DB_PORT:-5432}"
ports:
- "${SR_DB_PORT:-5432}:${SR_DB_PORT:-5432}"
# Spring Boot backend
backend:
build:
context: ./
dockerfile: backend/Dockerfile
image: ghcr.io/cdcgov/prime-simplereport/backend:${DOCKER_BACKEND_IMAGE_VERSION:-latest}
container_name: backend
env_file:
- .env
environment:
SPRING_PROFILES_ACTIVE: okta-local,db-dockerized,create-sample-data
SPRING_LIQUIBASE_ENABLED: "true"
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
depends_on:
- db
expose:
- "8080"
# React frontend
frontend:
build:
context: ./
dockerfile: frontend/Dockerfile
args:
REACT_APP_OKTA_URL: $REACT_APP_OKTA_URL
REACT_APP_BASE_URL: $REACT_APP_BASE_URL
REACT_APP_BACKEND_URL: $REACT_APP_BACKEND_URL
REACT_APP_OKTA_CLIENT_ID: $REACT_APP_OKTA_CLIENT_ID
PUBLIC_URL: $PUBLIC_URL
REACT_APP_OKTA_ENABLED: $REACT_APP_OKTA_ENABLED
REACT_APP_DISABLE_MAINTENANCE_BANNER: "true"
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
image: ghcr.io/cdcgov/prime-simplereport/frontend:${DOCKER_FRONTEND_IMAGE_VERSION:-latest}
container_name: frontend
expose:
- "3000"
# This is an nginx server that serves both the frontend and the backend
# at https://localhost.simplereport.gov, using certs generated by mkcert
nginx:
build:
context: nginx
image: ghcr.io/cdcgov/prime-simplereport/nginx:${DOCKER_NGINX_IMAGE_VERSION:-latest}
container_name: nginx
hostname: localhost.simplereport.gov
restart: "unless-stopped"
environment:
NGINX_ENTRYPOINT_QUIET_LOGS: 1
depends_on:
- backend
- frontend
ports:
- "80:80"
- "443:443"
mailhog:
ports:
- '1025:1025'
- '8025:8025'
image: mailhog/mailhog
volumes:
db-data:
node_modules: