| 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 | GIT_SSH_HOST_KEY: ${GIT_SSH_HOST_KEY:-} |
| 95 | GIT_SSH_PORT: 1031 |
| 96 | ZOEKT_URL: http://zoekt:6070 |
| 97 | ports: |
| 98 | - "3001:3001" |
| 99 | - "1031:1031" |
| 100 | |
| 101 | # No published port: zoekt answers for every repository, private ones included, so only the api, which checks access, may reach it. |
| 102 | zoekt: |
| 103 | build: |
| 104 | context: . |
| 105 | dockerfile: apps/zoekt/Dockerfile |
| 106 | restart: unless-stopped |
| 107 | depends_on: |
| 108 | bucket: |
| 109 | condition: service_completed_successfully |
| 110 | environment: |
| 111 | S3_ENDPOINT: http://rustfs:9000 |
| 112 | S3_ACCESS_KEY_ID: ghost |
| 113 | S3_SECRET_ACCESS_KEY: ghostsecret |
| 114 | S3_BUCKET: ghost |
| 115 | healthcheck: |
| 116 | test: ["CMD-SHELL", |
| 117 | interval: 5s |
| 118 | timeout: 5s |
| 119 | retries: 10 |
| 120 | |
| 121 | web: |
| 122 | build: |
| 123 | context: . |
| 124 | dockerfile: apps/web/Dockerfile |
| 125 | args: |
| 126 | # Baked into the browser bundle, so they have to be the host's URLs. |
| 127 | NEXT_PUBLIC_API_URL: http://localhost:3001 |
| 128 | NEXT_PUBLIC_SSH_CLONE_HOST: ${NEXT_PUBLIC_SSH_CLONE_HOST:-localhost:1031} |
| 129 | NEXT_PUBLIC_DOCS_URL: http://localhost:3003 |
| 130 | restart: unless-stopped |
| 131 | depends_on: |
| 132 | lgtm: |
| 133 | condition: service_healthy |
| 134 | |
| 135 | environment: |
| 136 | PORT: 3000 |
| 137 | OTEL_EXPORTER_OTLP_ENDPOINT: http://lgtm:4318 |
| 138 | # The Next.js server is inside the network, where `localhost` is itself. |
| 139 | INTERNAL_API_URL: http://api:3001 |
| 140 | ports: |
| 141 | - "3000:3000" |
| 142 | |
| 143 | docs: |
| 144 | build: |
| 145 | context: . |
| 146 | dockerfile: apps/docs/Dockerfile |
| 147 | args: |
| 148 | # Both are baked into the bundle, so they have to be the host's URLs. |
| 149 | NEXT_PUBLIC_DOCS_URL: http://localhost:3003 |
| 150 | NEXT_PUBLIC_WEB_APP_URL: http://localhost:3000 |
| 151 | restart: unless-stopped |
| 152 | environment: |
| 153 | PORT: 3003 |
| 154 | ports: |
| 155 | - "3003:3003" |
| 156 | |
| 157 | lgtm: |
| 158 | image: grafana/otel-lgtm:latest |
| 159 | restart: unless-stopped |
| 160 | ports: |
| 161 | - "3100:3000" # |
| 162 | - "4317:4317" # |
| 163 | - "4318:4318" # |
| 164 | - "4040:4040" # |
| 165 | environment: |
| 166 | GF_SECURITY_ADMIN_USER: ${GRAFANA_USER:-admin} |
| 167 | GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:?set GRAFANA_PASSWORD in .env} |
| 168 | GF_AUTH_ANONYMOUS_ENABLED: "false" |
| 169 | GF_USERS_ALLOW_SIGN_UP: "false" |
| 170 | GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /otel-lgtm/grafana/conf/provisioning/dashboards/ghost/ghost.json |
| 171 | volumes: |
| 172 | - lgtm:/data |
| 173 | - ./grafana/dashboards.yaml:/otel-lgtm/grafana/conf/provisioning/dashboards/ghost.yaml:ro |
| 174 | - ./grafana/ghost.json:/otel-lgtm/grafana/conf/provisioning/dashboards/ghost/ghost.json:ro |
| 175 | |
| 176 | volumes: |
| 177 | postgres: |
| 178 | lgtm: |
| 179 | rustfs: |
| 180 | rustfs_logs: |