-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yaml
90 lines (85 loc) · 2.44 KB
/
docker-compose.prod.yaml
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
services:
traefik:
image: traefik:v2.9
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.cloudflare.acme.dnschallenge=true"
- "--certificatesresolvers.cloudflare.acme.dnschallenge.provider=cloudflare"
- "--certificatesresolvers.cloudflare.acme.email=contact@warrensnipse.dev"
- "--certificatesresolvers.cloudflare.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
env_file: .cloudflare
restart: always
db:
image: "postgres:16.3"
restart: always
command: ["postgres", "-c", "log_statement=all"]
environment:
POSTGRES_DB: findmyprofessors_api_development
POSTGRES_USER: api
POSTGRES_PASSWORD: test
volumes:
- .server/postgres-data:/var/lib/postgresql/data
- .server/postgres-logs:/logs:z
- ./scripts/init-database.sh:/docker-entrypoint-initdb.d/init-database.sh
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
api:
restart: always
build:
context: ./api
dockerfile: Dockerfile
#ports:
# - 8080:8080
env_file:
- api/.prod.env
environment:
NODE_ENV: production
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`findmyprofessors-api.warrensnipes.dev`)"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.tls.certresolver=cloudflare"
web:
restart: always
build:
context: ./web
dockerfile: Dockerfile
environment:
NODE_ENV: production
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.http.routers.web.rule=Host(`findmyprofessors.warrensnipes.dev`)"
- "traefik.http.routers.web.entrypoints=websecure"
- "traefik.http.routers.web.tls.certresolver=cloudflare"
pgadmin:
image: dpage/pgadmin4
restart: always
depends_on:
- db
#ports:
# - "8888:80"
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin
volumes:
- pgadmin:/var/lib/pgadmin
- ./scripts/servers.json:/pgadmin4/servers.json
volumes:
letsencrypt:
pgadmin: