42 lines
1.4 KiB
YAML
42 lines
1.4 KiB
YAML
services:
|
|
# One-shot build container. Bind-mounts the repo, runs pnpm install + generate,
|
|
# writes .output to the host, then exits.
|
|
# Usage: docker compose --profile build run --rm build
|
|
build:
|
|
image: "village-politics-frontend-build:latest"
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.build
|
|
volumes:
|
|
- .:/app
|
|
- ./docker-data/node_modules:/app/node_modules
|
|
env_file:
|
|
- .env
|
|
profiles:
|
|
- build
|
|
|
|
# Long-running static server for the generated SPA in .output/public.
|
|
frontend:
|
|
image: "nginx:stable-alpine"
|
|
container_name: village-politics-frontend
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./.output/public:/usr/share/nginx/html:ro
|
|
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
labels:
|
|
traefik.enable: "true"
|
|
traefik.docker.network: "web"
|
|
# nginx on the host terminates TLS with the *.blax.at wildcard cert and
|
|
# forwards plain HTTP to traefik's `web` entrypoint. This router beats
|
|
# blax-nuxt-website's *.blax.at fallback router (priority -100).
|
|
traefik.http.routers.village-frontend.rule: "Host(`village.blax.at`) || Host(`village.localhost.at`)"
|
|
traefik.http.routers.village-frontend.entrypoints: "web"
|
|
traefik.http.routers.village-frontend.service: "village-frontend-http"
|
|
traefik.http.services.village-frontend-http.loadbalancer.server.port: "80"
|
|
|
|
networks:
|
|
default:
|
|
name: web
|
|
external: true
|
|
driver: bridge
|