-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.caddy.yml
54 lines (48 loc) · 1.36 KB
/
docker-compose.caddy.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
name: FarmCart-Caddy
services:
api:
build:
context: ./backend
dockerfile: Dockerfile.prod
restart: unless-stopped
env_file: ./backend/.env.prod
networks:
- app-network-caddy
deploy:
mode: replicated
replicas: 2
healthcheck:
test: ["CMD", "curl", "-f", "api:5002/health"] # Use service name instead of localhost
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
# ports:
# - "5002:5002" # Expose the API on port 5002 for internal communication
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod # This Dockerfile serves React with Caddy
args:
- VITE_STRIPE_PUBLIC_KEY=pk_test_51LMEvTC05RrpHY1zUINiBb70Oue9TVmbH9LoKTZKKa0Ra3a8J188Ph3kouCpSeLJUr7qCgndpWlAXwt5GVlZOLIY00SkMj6avh
- VITE_MAPBOX_API_KEY=pk.eyJ1IjoibGtzbmp3IiwiYSI6ImNtMjA2c3ZkOTBiYWwyaXF2M2lqM2tleTQifQ.DZLGqlXwdK7VmyE1zlpxDg
restart: unless-stopped
env_file: ./frontend/.env.prod
ports:
- 80:80 # HTTP port
- 443:443 # HTTPS port for SSL
volumes:
- $PWD/frontend/caddy/Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
depends_on:
- api
networks:
- app-network-caddy
networks:
app-network-caddy:
driver: bridge
volumes:
caddy_data:
external: true
caddy_config: