- Build the image
docker build --pull --no-cache
- Run the server
docker compose up --detach --force-recreate
{$SERVER_NAME} { | |
root * /srv/app/public | |
file_server | |
try_files {path} /index.html | |
} |
services: | |
app: | |
build: | |
context: . | |
target: caddy | |
container_name: flutter-app | |
restart: always | |
volumes: | |
- ./etc/config:/config | |
- ./etc/data:/data | |
networks: | |
- lan | |
environment: | |
SERVER_NAME: :80 | |
labels: | |
traefik.enable: true | |
traefik.http.services.demo.loadbalancer.server.port: 80 | |
traefik.http.routers.demo-https.rule: Host(`${SERVER_NAME}`) | |
traefik.http.routers.demo-https.entrypoints: https | |
traefik.http.routers.demo-https.service: demo | |
networks: | |
lan: | |
external: true |
FROM caddy:2.8.4 AS caddy | |
WORKDIR /srv/app | |
COPY --link ./web public/ | |
COPY --link ./Caddyfile /etc/caddy/Caddyfile |