Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
60 lines (54 loc) · 1.83 KB
/
Copy pathdocker-compose.yml
File metadata and controls
60 lines (54 loc) · 1.83 KB
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
# Solve For Sakthi - production stack: backend (Express) + frontend (nginx)
# The SQL Server database is external; its connection details come from .env
#
# cp backend/.env.example backend/.env # database, mail, secrets, CORS_ORIGINS
# cp frontend/.env.example frontend/.env # VITE_API_URL (backend link), /api by default
# docker compose up -d --build
#
# Frontend: http://<server>:9021 (API is proxied at /api)
# Backend: http://<server>:9022 (direct access, e.g. for monitoring)
name: solve-for-sakthi
x-logging: &logging
driver: json-file
options:
max-size: "10m"
max-file: "5"
services:
backend:
build: ./backend
restart: unless-stopped
# database, mail, secrets and CORS_ORIGINS live in backend/.env
env_file: ./backend/.env
# time to finish requests and mails that are still being sent before the container is stopped
stop_grace_period: 30s
environment:
NODE_ENV: production
PORT: 9022
# lets DB_HOST=host.docker.internal reach a SQL Server running on the Docker host itself
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "9022:9022"
volumes:
- uploads:/app/uploads
logging: *logging
frontend:
# the backend link (VITE_API_URL) comes from frontend/.env
build: ./frontend
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
ports:
- "9021:9021"
logging: *logging
# Smaller packets on the containers' network. Cloud / VPN networks often carry less than Docker's
# default 1500 bytes; then small packets (connect, login) work but full-size ones (the TLS-encrypted
# mail body) are silently dropped and sending stalls. 1400 fits through those links.
networks:
default:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: "1400"
volumes:
uploads: