# Two-container setup using the pre-built image from GitHub Container Registry. # Pull the latest image: docker compose pull # Start: docker compose up -d # # NOTE: VITE_API_URL is baked into the frontend at image-build time. # If you need a custom backend URL, build the image yourself: # docker build --build-arg VITE_API_URL=http://your-host:3000 -t invoice-builder . # and replace the `image:` lines below with `image: invoice-builder`. services: backend: image: ghcr.io/piratuks/invoice-builder:latest # To build locally instead of pulling, uncomment the line below and remove the image: line above: # build: . extra_hosts: - 'host.docker.internal:host-gateway' container_name: backend # backend internal-only, works only via nginx # ports: # - '3000:3000' environment: - SERVICE=backend - NODE_ENV=docker - DB_DIRECTORY=/data # Backend webserver port - PORT=3000 # Backend webserver host - DEV_SERVER_URL=0.0.0.0 # Frontend webserver URL - FE_SERVER_URL=http://localhost:3001 # Path to migration files in docker volume - MIGRATIONS_PATH=/app/dist-be/backend/server/shared/migrations volumes: - app-data:/data healthcheck: test: [ 'CMD', 'node', '-e', "const net=require('net');const c=net.createConnection(3000,'localhost');c.on('connect',()=>{c.destroy();process.exit(0)});c.on('error',()=>process.exit(1))" ] interval: 5s timeout: 3s retries: 10 start_period: 10s frontend: image: ghcr.io/piratuks/invoice-builder:latest # To build locally instead of pulling, uncomment below and remove the image: line above: # build: . # build: # context: . # dockerfile: Dockerfile # args: # VITE_API_URL: ${VITE_API_URL} container_name: frontend ports: - '3001:3001' environment: - SERVICE=frontend # nginx inside the container proxies /api/* here; # 'backend' resolves to the backend container via Docker's internal DNS. - BACKEND_HOST=backend - BACKEND_PORT=3000 depends_on: backend: condition: service_healthy volumes: app-data: