-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (66 loc) · 1.79 KB
/
Copy pathdocker-compose.yml
File metadata and controls
72 lines (66 loc) · 1.79 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
61
62
63
64
65
66
67
68
69
70
71
72
version: '3.8'
services:
# 1. Express API Backend (SQLite)
backend:
build:
context: ./apps/backend
dockerfile: Dockerfile
container_name: deepa-bms-backend
restart: always
env_file:
- .env
environment:
NODE_ENV: production
PORT: 3000
SQLITE_DB_PATH: /app/data/deepa-bms.db
ports:
- "3000:3000"
volumes:
- bms-sqlite:/app/data
networks:
- bms-net
# 2. Static Nginx Web Router (Web Client app delivery)
web:
image: nginx:stable-alpine
container_name: deepa-bms-web-client
restart: always
ports:
- "80:80"
volumes:
- ./apps/web/dist:/usr/share/nginx/html
networks:
- bms-net
# 3. Cloudflare Tunnel (Enables secure sync from any network/internet without port forwarding)
# OPTION A: Persistent Tunnel (Recommended for production, requires a Cloudflare Account & token)
# To use: create a tunnel in Cloudflare Dashboard, get the token, and add it to your .env file
tunnel-prod:
image: cloudflare/cloudflared:latest
container_name: deepa-bms-tunnel-prod
restart: always
environment:
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}
command: tunnel --no-autoupdate run
depends_on:
- backend
networks:
- bms-net
profiles:
- production
# OPTION B: Quick Tunnel (Recommended for instant zero-config testing)
# To use: run `docker compose --profile demo up` and check the logs for the temporary public HTTPS URL
tunnel-demo:
image: cloudflare/cloudflared:latest
container_name: deepa-bms-tunnel-demo
restart: always
command: tunnel --no-autoupdate --url http://backend:3000
depends_on:
- backend
networks:
- bms-net
profiles:
- demo
volumes:
bms-sqlite:
networks:
bms-net:
driver: bridge