File size: 1,070 Bytes
c6dfde3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Runs on the Oracle Always Free VM.
#
#   app   — backend (:8000) + RAG (localhost:8787), data on a persistent volume
#   caddy — reverse proxy that terminates HTTPS with automatic Let's Encrypt
#
# The frontend (Vercel, HTTPS) can only talk to an HTTPS backend, so all public
# traffic goes through Caddy on 443. The app container is never exposed directly.
services:
  app:
    build: .
    restart: unless-stopped
    env_file:
      - .env.production
    volumes:
      - askneo-data:/data        # SQLite lives here (DB_PATH=/data/database.db)
    expose:
      - "8000"                    # visible to caddy only, not the public internet

  caddy:
    image: caddy:2
    restart: unless-stopped
    depends_on:
      - app
    ports:
      - "80:80"                   # needed for the HTTP-01 ACME challenge + redirect
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy-data:/data          # persists issued certificates across restarts
      - caddy-config:/config

volumes:
  askneo-data:
  caddy-data:
  caddy-config: