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 13:35:35 +08:00
|
|
|
|
|
|
|
env_file:
|
2024-10-08 13:56:36 +08:00
|
|
|
- .env.local
|
2024-10-08 13:35:35 +08:00
|
|
|
ports:
|
|
|
|
- '3000:3000'
|
|
|
|
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
|
|
|
|
- traefik.http.routers.frontend-http.middlewares=https-redirect,www-redirect
|
2024-10-08 13:35:35 +08:00
|
|
|
networks:
|
|
|
|
- traefik-public
|
|
|
|
- default
|