File size: 1,595 Bytes
c7d34c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: gpt-image-playground-customer

services:
  postgres:
    image: postgres:16-alpine
    container_name: gpt-image-playground-postgres
    restart: unless-stopped
    environment:
      POSTGRES_DB: gpt_image_playground
      POSTGRES_USER: gpt_image
      POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
    secrets:
      - postgres_password
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U gpt_image -d gpt_image_playground"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - postgres-data:/var/lib/postgresql/data

  gpt-image-playground:
    build:
      context: .
    image: gpt-image-playground-customer:postgres
    container_name: gpt-image-playground-customer
    restart: unless-stopped
    env_file:
      - path: .env.local
        required: false
    environment:
      NODE_ENV: production
      NEXT_TELEMETRY_DISABLED: "1"
      NEXT_PUBLIC_IMAGE_STORAGE_MODE: fs
      AGENT_STATE_BACKEND: postgres
      # Force Docker secret fields below even if .env.local contains AGENT_DATABASE_URL.
      AGENT_DATABASE_URL: ""
      AGENT_DB_HOST: postgres
      AGENT_DB_PORT: "5432"
      AGENT_DB_NAME: gpt_image_playground
      AGENT_DB_USER: gpt_image
      AGENT_DB_PASSWORD_FILE: /run/secrets/postgres_password
      PORT: "4783"
    secrets:
      - postgres_password
    depends_on:
      postgres:
        condition: service_healthy
    ports:
      - "4783:4783"
    volumes:
      - ./generated-images:/app/generated-images

volumes:
  postgres-data:

secrets:
  postgres_password:
    environment: GPT_IMAGE_POSTGRES_PASSWORD