| 1 | name: ghost |
| 2 | |
| 3 | services: |
| 4 | postgres: |
| 5 | image: postgres:18-alpine |
| 6 | restart: unless-stopped |
| 7 | environment: |
| 8 | POSTGRES_USER: postgres |
| 9 | POSTGRES_PASSWORD: postgres |
| 10 | POSTGRES_DB: ghost |
| 11 | ports: |
| 12 | - "5432:5432" |
| 13 | volumes: |
| 14 | - postgres:/var/lib/postgresql |
| 15 | healthcheck: |
| 16 | test: ["CMD-SHELL", |
| 17 | interval: 5s |
| 18 | timeout: 5s |
| 19 | retries: 10 |
| 20 | |
| 21 | rustfs: |
| 22 | image: rustfs/rustfs:latest |
| 23 | restart: unless-stopped |
| 24 | environment: |
| 25 | RUSTFS_VOLUMES: /data |
| 26 | RUSTFS_ADDRESS: 0.0.0.0:9000 |
| 27 | RUSTFS_CONSOLE_ADDRESS: 0.0.0.0:9001 |
| 28 | RUSTFS_CONSOLE_ENABLE: "true" |
| 29 | RUSTFS_ACCESS_KEY: ghost |
| 30 | RUSTFS_SECRET_KEY: ghostsecret |
| 31 | ports: |
| 32 | - "9000:9000" # |
| 33 | - "9001:9001" # |
| 34 | volumes: |
| 35 | - rustfs:/data |
| 36 | - rustfs_logs:/logs |
| 37 | healthcheck: |
| 38 | test: ["CMD-SHELL", |
| 39 | interval: 5s |
| 40 | timeout: 5s |
| 41 | retries: 20 |
| 42 | start_period: 20s |
| 43 | |
| 44 | bucket: |
| 45 | image: amazon/aws-cli:latest |
| 46 | depends_on: |
| 47 | rustfs: |
| 48 | condition: service_healthy |
| 49 | environment: |
| 50 | AWS_ACCESS_KEY_ID: ghost |
| 51 | AWS_SECRET_ACCESS_KEY: ghostsecret |
| 52 | AWS_DEFAULT_REGION: auto |
| 53 | entrypoint: ["/bin/sh", |
| 54 | command: |
| 55 | - "aws --endpoint-url http://rustfs:9000 s3api create-bucket --bucket ghost || aws --endpoint-url http://rustfs:9000 s3api head-bucket --bucket ghost" |
| 56 | restart: "no" |
| 57 | |
| 58 | migrate: |
| 59 | build: |
| 60 | context: . |
| 61 | dockerfile: apps/api/Dockerfile |
| 62 | depends_on: |
| 63 | postgres: |
| 64 | condition: service_healthy |
| 65 | environment: |
| 66 | DATABASE_URL: postgres://postgres:postgres@postgres:5432/ghost |
| 67 | command: ["node", |
| 68 | restart: "no" |
| 69 | |
| 70 | api: |
| 71 | build: |
| 72 | context: . |
| 73 | dockerfile: apps/api/Dockerfile |
| 74 | restart: unless-stopped |
| 75 | depends_on: |
| 76 | migrate: |
| 77 | condition: service_completed_successfully |
| 78 | bucket: |
| 79 | condition: service_completed_successfully |
| 80 | lgtm: |
| 81 | condition: service_healthy |
| 82 | environment: |
| 83 | PORT: 3001 |
| 84 | OTEL_EXPORTER_OTLP_ENDPOINT: http://lgtm:4318 |
| 85 | PYROSCOPE_SERVER_ADDRESS: http://lgtm:4040 |
| 86 | DATABASE_URL: postgres://postgres:postgres@postgres:5432/ghost |
| 87 | BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:-devsecretdevsecretdevsecret00000} |
| 88 | BETTER_AUTH_URL: http://localhost:3001 |
| 89 | AUTH_TRUSTED_ORIGINS: http://localhost:3000 |
| 90 | S3_ENDPOINT: http://rustfs:9000 |
| 91 | S3_ACCESS_KEY_ID: ghost |
| 92 | S3_SECRET_ACCESS_KEY: ghostsecret |
| 93 | S3_BUCKET: ghost |
| 94 | ports: |
| 95 | - "3001:3001" |
| 96 | |
| 97 | web: |
| 98 | build: |
| 99 | context: . |
| 100 | dockerfile: apps/web/Dockerfile |
| 101 | args: |
| 102 | # Baked into the browser bundle, so they have to be the host's URLs. |
| 103 | NEXT_PUBLIC_API_URL: http://localhost:3001 |
| 104 | NEXT_PUBLIC_DOCS_URL: http://localhost:3003 |
| 105 | restart: unless-stopped |
| 106 | depends_on: |
| 107 | lgtm: |
| 108 | condition: service_healthy |
| 109 | |
| 110 | environment: |
| 111 | PORT: 3000 |
| 112 | OTEL_EXPORTER_OTLP_ENDPOINT: http://lgtm:4318 |
| 113 | # The Next.js server is inside the network, where `localhost` is itself. |
| 114 | INTERNAL_API_URL: http://api:3001 |
| 115 | ports: |
| 116 | - "3000:3000" |
| 117 | |
| 118 | docs: |
| 119 | build: |
| 120 | context: . |
| 121 | dockerfile: apps/docs/Dockerfile |
| 122 | args: |
| 123 | # Both are baked into the bundle, so they have to be the host's URLs. |
| 124 | NEXT_PUBLIC_DOCS_URL: http://localhost:3003 |
| 125 | NEXT_PUBLIC_WEB_APP_URL: http://localhost:3000 |
| 126 | restart: unless-stopped |
| 127 | environment: |
| 128 | PORT: 3003 |
| 129 | ports: |
| 130 | - "3003:3003" |
| 131 | |
| 132 | lgtm: |
| 133 | image: grafana/otel-lgtm:latest |
| 134 | restart: unless-stopped |
| 135 | ports: |
| 136 | - "3100:3000" # |
| 137 | - "4317:4317" # |
| 138 | - "4318:4318" # |
| 139 | - "4040:4040" # |
| 140 | environment: |
| 141 | GF_SECURITY_ADMIN_USER: ${GRAFANA_USER:-admin} |
| 142 | GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:?set GRAFANA_PASSWORD in .env} |
| 143 | GF_AUTH_ANONYMOUS_ENABLED: "false" |
| 144 | GF_USERS_ALLOW_SIGN_UP: "false" |
| 145 | GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /otel-lgtm/grafana/conf/provisioning/dashboards/ghost/ghost.json |
| 146 | volumes: |
| 147 | - lgtm:/data |
| 148 | - ./grafana/dashboards.yaml:/otel-lgtm/grafana/conf/provisioning/dashboards/ghost.yaml:ro |
| 149 | - ./grafana/ghost.json:/otel-lgtm/grafana/conf/provisioning/dashboards/ghost/ghost.json:ro |
| 150 | |
| 151 | volumes: |
| 152 | postgres: |
| 153 | lgtm: |
| 154 | rustfs: |
| 155 | rustfs_logs: |