-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
144 lines (133 loc) · 3.17 KB
/
docker-compose.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
services:
# ============== [Dev] ==============
backend-dev:
image: backend-search-dev:latest
build: ./backend
restart: on-failure
ports:
- "127.0.0.1:8080:8080"
command: >
sh -c "
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8080
"
profiles:
- dev
volumes:
- ./backend:/app
- .env:/app/.env
frontend-dev:
image: frontend-search-dev:latest
build: ./frontend
restart: on-failure
ports:
- "127.0.0.1:5173:5173"
profiles:
- dev
volumes:
- ./frontend:/app
- .env:/app/.env
# ============== [Prod] ==============
elastic-prod:
image: elastic-search-prod:latest
build: ./backend/db
restart: on-failure
ports:
- "9200:9200"
- "9300:9300"
profiles:
- prod
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
env_file:
- .env
environment:
- discovery.type=single-node
backend-prod:
image: backend-search-prod:latest
build: ./backend
restart: on-failure
expose:
- "8080"
command: >
sh -c "
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8080
"
env_file:
- .env
environment:
- VIRTUAL_HOST=api.justcheckinghow.com
- VIRTUAL_PORT=8080
- LETSENCRYPT_HOST=api.justcheckinghow.com
profiles:
- prod
frontend-prod:
image: frontend-search-prod:latest
build: ./frontend
restart: on-failure
expose:
- "5173"
command: "npm run dev"
env_file:
- .env
environment:
- VIRTUAL_HOST=justcheckinghow.com
- VIRTUAL_PORT=5173
- LETSENCRYPT_HOST=justcheckinghow.com
- BACKEND_URL=https://api.justcheckinghow.com
profiles:
- prod
nginx-proxy:
image: nginx
container_name: nginx-proxy
ports:
- "${DOCKER_EGRESS_IP}:80:80"
- "${DOCKER_EGRESS_IP}:443:443"
volumes:
- conf:/etc/nginx/conf.d
- vhost:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- certs:/etc/nginx/certs:ro
- static:/var/www/backend/static
restart: always
profiles:
- prod
docker-gen:
image: nginxproxy/docker-gen
container_name: nginx-proxy-gen
command: >
-notify-sighup nginx-proxy
-watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
volumes_from:
- nginx-proxy
volumes:
- ./egress.nginx.conf:/etc/docker-gen/templates/nginx.tmpl:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
restart: always
profiles:
- prod
acme-companion:
image: nginxproxy/acme-companion
container_name: nginx-proxy-acme
volumes_from:
- nginx-proxy
volumes:
- certs:/etc/nginx/certs:rw
- acme:/etc/acme.sh
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- NGINX_PROXY_CONTAINER=nginx-proxy
- NGINX_DOCKER_GEN_CONTAINER=nginx-proxy-gen
# - ACME_CA_URI=https://acme-staging-v02.api.letsencrypt.org/directory
- DEFAULT_EMAIL=${PROXY_MAIL}
- DEBUG=1
restart: always
profiles:
- prod
volumes:
elasticsearch_data:
static:
conf:
vhost:
html:
certs:
acme: