frondend/docker-compose.yml

40 lines
1.2 KiB
YAML
Raw Normal View History

2024-10-08 13:35:35 +08:00
services:
app:
build:
context: .
dockerfile: Dockerfile
2024-10-08 14:11:14 +08:00
container_name: allAndOne
2024-10-08 14:21:22 +08:00
2024-10-08 13:35:35 +08:00
env_file:
2024-10-08 14:17:22 +08:00
- .env
2024-10-08 13:35:35 +08:00
ports:
2024-10-08 14:21:22 +08:00
- "3000:3000"
2024-10-08 13:35:35 +08:00
volumes:
- .:/app
- /app/node_modules
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.constraint-label=traefik-public
2024-10-08 14:11:14 +08:00
- traefik.http-frontend.loadbalancer.server.port=80
2024-10-08 13:35:35 +08:00
2024-10-08 14:11:14 +08:00
- traefik.http.routers.frontend-http.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`)
- traefik.http.routers.frontend-http.entrypoints=http
2024-10-08 13:35:35 +08:00
2024-10-08 14:11:14 +08:00
- traefik.http.routers.frontend-https.rule=Host(`${DOMAIN?Variable not set}`) || Host(`www.${DOMAIN?Variable not set}`)
- traefik.http.routers.frontend-https.entrypoints=https
- traefik.http.routers.frontend-https.tls=true
- traefik.http.routers.frontend-https.tls.certresolver=le
2024-10-08 13:35:35 +08:00
# Enable www redirection for HTTP and HTTPS
2024-10-08 14:11:14 +08:00
- traefik.http.routers.frontend-https.middlewares=www-redirect
2024-10-08 14:21:22 +08:00
- traefik.http.routers.frontend-http.middlewares=https-redirect,www-redirect
2024-10-08 13:35:35 +08:00
networks:
- traefik-public
2024-10-08 14:21:22 +08:00
- default
networks:
traefik-public:
# Allow setting it to false for testing
external: true