forked from CDCgov/prime-simplereport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
82 lines (82 loc) · 2.55 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
services:
# Postgresql database
db:
image: postgres:13-alpine
container_name: "${DB_NAME:-db}"
environment:
POSTGRES_PASSWORD: admin_password_for_local_dev_is_not_very_secure
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/reset-metabase-db.sql:/usr/local/lib/reset-metabase-db.sql
command: -p ${SR_DB_PORT:-5432}
expose:
- "${SR_DB_PORT:-5432}"
ports:
- "${SR_DB_PORT:-5432}:${SR_DB_PORT:-5432}"
# Spring Boot backend
backend:
build:
context: backend
image: ghcr.io/cdcgov/prime-simplereport/backend:latest
container_name: backend
env_file:
- .env
environment:
SPRING_PROFILES_ACTIVE: okta-local,db-dockerized
SPRING_LIQUIBASE_ENABLED: "true"
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
volumes:
- ./.git:/app/.git
- ./backend:/app/backend/
depends_on:
- db
expose:
- "8080"
# React frontend
frontend:
build:
context: frontend
image: ghcr.io/cdcgov/prime-simplereport/frontend:latest
container_name: frontend
environment:
REACT_APP_BASE_URL: https://localhost.simplereport.gov
REACT_APP_BACKEND_URL: https://localhost.simplereport.gov/api
PUBLIC_URL: /app/
REACT_APP_OKTA_ENABLED: "true"
REACT_APP_DISABLE_MAINTENANCE_BANNER: "true"
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
volumes:
- ./.git:/app/.git
- ./frontend:/app/frontend/
- node_modules:/app/frontend/node_modules
- ./backend/src/main/resources/graphql:/app/backend/src/main/resources/graphql
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:latest
container_name: nginx
depends_on:
- backend
- frontend
volumes:
- ./certs:/etc/nginx/certs
ports:
- "80:80"
- "443:443"
mailhog:
ports:
- '1025:1025'
- '8025:8025'
image: mailhog/mailhog
volumes:
db-data:
node_modules: