Skip to content

Instantly share code, notes, and snippets.

@herveGuigoz
Last active April 21, 2025 08:51
Show Gist options
  • Save herveGuigoz/eac8ab9a5ae2f88791e065e167fb1935 to your computer and use it in GitHub Desktop.
Save herveGuigoz/eac8ab9a5ae2f88791e065e167fb1935 to your computer and use it in GitHub Desktop.
Flutter Caddy

Getting Started

  1. Build the image
docker build --pull --no-cache
  1. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment