services:
  caddy:
    container_name: proxy
    image: caddy:latest
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./.caddy/Caddyfile.dev:/etc/caddy/Caddyfile:rw
    networks:
      - web_proxy
    depends_on:
      - web

  web:
    container_name: web
    image: web:dev
    volumes:
      - ./src/node_modules:/app/node_modules
      - ./src/sandbox.config.json:/app/sandbox.config.json
      - ./src/.stackblitzrc:/app/.stackblitzrc
      - ./src/astro.config.mjs:/app/astro.config.mjs
      - ./src/tailwind.config.cjs:/app/tailwind.config.cjs
      - ./src/tsconfig.json:/app/tsconfig.json
      - ./src/pnpm-lock.yaml:/app/pnpm-lock.yaml
      - ./src/package.json:/app/package.json
      - ./src/public:/app/public
      - ./src/src:/app/src
    networks:
      - web_proxy

networks:
  web_proxy:
    name: web_proxy
    external: true
