|
| 1 | +version: '3.6' |
| 2 | +services: |
| 3 | + traefik: |
| 4 | + image: "traefik:v2.5" |
| 5 | + container_name: "traefik" |
| 6 | + command: |
| 7 | + - "--api.insecure=true" |
| 8 | + - "--providers.docker=true" |
| 9 | + - "--providers.docker.exposedbydefault=false" |
| 10 | + - "--entrypoints.web.address=:1337" |
| 11 | + ports: |
| 12 | + - "1337:1337" |
| 13 | + - "9090:8080" |
| 14 | + volumes: |
| 15 | + - "/var/run/docker.sock:/var/run/docker.sock:ro" |
| 16 | + postgres: |
| 17 | + image: postgres |
| 18 | + restart: always |
| 19 | + volumes: |
| 20 | + - ./data/db:/var/lib/postgresql/data |
| 21 | + - ./initdb.d:/docker-entrypoint-initdb.d:ro |
| 22 | + environment: |
| 23 | + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-secretpgpassword} |
| 24 | + ports: |
| 25 | + - '5432:5432' |
| 26 | + graphql-engine: |
| 27 | + image: hasura/graphql-engine:v2.2.0 |
| 28 | + depends_on: |
| 29 | + - 'postgres' |
| 30 | + restart: always |
| 31 | + expose: |
| 32 | + - 8080 |
| 33 | + environment: |
| 34 | + HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD:-secretpgpassword}@postgres:5432/postgres |
| 35 | + HASURA_GRAPHQL_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET} |
| 36 | + HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET} |
| 37 | + HASURA_GRAPHQL_UNAUTHORIZED_ROLE: public |
| 38 | + HASURA_GRAPHQL_LOG_LEVEL: debug |
| 39 | + HASURA_GRAPHQL_ENABLE_CONSOLE: 'true' |
| 40 | + labels: |
| 41 | + - "traefik.enable=true" |
| 42 | + - "traefik.http.routers.hasura.rule=Host(`localhost`) && PathPrefix(`/`)" |
| 43 | + - "traefik.http.routers.hasura.entrypoints=web" |
| 44 | + auth: |
| 45 | + image: nhost/hasura-auth:latest |
| 46 | + depends_on: |
| 47 | + - postgres |
| 48 | + - graphql-engine |
| 49 | + restart: always |
| 50 | + environment: |
| 51 | + AUTH_HOST: '0.0.0.0' |
| 52 | + HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD:-secretpgpassword}@postgres:5432/postgres |
| 53 | + HASURA_GRAPHQL_GRAPHQL_URL: http://graphql-engine:8080/v1/graphql |
| 54 | + HASURA_GRAPHQL_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET} |
| 55 | + HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET} |
| 56 | + AUTH_CLIENT_URL: ${AUTH_CLIENT_URL:-http://localhost:3000} |
| 57 | + AUTH_SMTP_HOST: mailhog |
| 58 | + AUTH_SMTP_PORT: 1025 |
| 59 | + AUTH_SMTP_USER: user |
| 60 | + AUTH_SMTP_PASS: password |
| 61 | + AUTH_SMTP_SENDER: [email protected] |
| 62 | + expose: |
| 63 | + - 4000 |
| 64 | + healthcheck: |
| 65 | + disable: true |
| 66 | + labels: |
| 67 | + - "traefik.enable=true" |
| 68 | + - "traefik.http.middlewares.strip-auth.stripprefix.prefixes=/v1/auth" |
| 69 | + - "traefik.http.routers.auth.rule=Host(`localhost`) && PathPrefix(`/v1/auth`)" |
| 70 | + - "traefik.http.routers.auth.middlewares=strip-auth@docker" |
| 71 | + - "traefik.http.routers.auth.entrypoints=web" |
| 72 | + storage: |
| 73 | + image: nhost/hasura-storage:0.2.1 |
| 74 | + depends_on: |
| 75 | + - postgres |
| 76 | + - graphql-engine |
| 77 | + - minio |
| 78 | + restart: always |
| 79 | + expose: |
| 80 | + - 8000 |
| 81 | + healthcheck: |
| 82 | + disable: true |
| 83 | + environment: |
| 84 | + PUBLIC_URL: http://localhost:${PROXY_PORT:-1337} |
| 85 | + HASURA_METADATA: 1 |
| 86 | + HASURA_ENDPOINT: http://graphql-engine:8080/v1 |
| 87 | + HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET} |
| 88 | + S3_ACCESS_KEY: ${STORAGE_ACCESS_KEY} |
| 89 | + S3_SECRET_KEY: ${STORAGE_SECRET_KEY} |
| 90 | + S3_ENDPOINT: http://minio:8484 |
| 91 | + S3_BUCKET: nhost |
| 92 | + POSTGRES_MIGRATIONS: 1 |
| 93 | + POSTGRES_MIGRATIONS_SOURCE: postgres://postgres:${POSTGRES_PASSWORD:-secretpgpassword}@postgres:5432/postgres?sslmode=disable |
| 94 | + labels: |
| 95 | + - "traefik.enable=true" |
| 96 | + - "traefik.http.routers.storage.rule=Host(`localhost`) && PathPrefix(`/v1/storage`)" |
| 97 | + - "traefik.http.routers.storage.entrypoints=web" |
| 98 | + # Rewrite the path so it matches with the new storage API path introduced in hasura-storage 0.2 |
| 99 | + - "traefik.http.middlewares.strip-suffix.replacepathregex.regex=^/v1/storage/(.*)" |
| 100 | + - "traefik.http.middlewares.strip-suffix.replacepathregex.replacement=/v1/$$1" |
| 101 | + - "traefik.http.routers.storage.middlewares=strip-suffix@docker" |
| 102 | + command: serve |
| 103 | + functions: |
| 104 | + build: .. |
| 105 | + labels: |
| 106 | + - "traefik.enable=true" |
| 107 | + - "traefik.http.middlewares.strip-functions.stripprefix.prefixes=/v1/functions" |
| 108 | + - "traefik.http.routers.functions.rule=Host(`localhost`) && PathPrefix(`/v1/functions`)" |
| 109 | + - "traefik.http.routers.functions.middlewares=strip-functions@docker" |
| 110 | + - "traefik.http.routers.functions.entrypoints=web" |
| 111 | + restart: always |
| 112 | + expose: |
| 113 | + - 3000 |
| 114 | + healthcheck: |
| 115 | + disable: true |
| 116 | + volumes: |
| 117 | + - .:/opt/project |
| 118 | + - functions_node_modules:/opt/project/node_modules |
| 119 | + - /opt/project/data/ |
| 120 | + - /opt/project/initdb.d/ |
| 121 | + - /opt/project/docker-functions/ |
| 122 | + minio: |
| 123 | + image: minio/minio:RELEASE.2021-09-24T00-24-24Z |
| 124 | + entrypoint: sh |
| 125 | + command: -c 'mkdir -p /data/nhost && /opt/bin/minio server --address :8484 /data' |
| 126 | + environment: |
| 127 | + MINIO_ROOT_USER: ${STORAGE_ACCESS_KEY} |
| 128 | + MINIO_ROOT_PASSWORD: ${STORAGE_SECRET_KEY} |
| 129 | + ports: |
| 130 | + - ${MINIO_PORT:-8484}:8484 |
| 131 | + volumes: |
| 132 | + - ./data/minio:/data |
| 133 | + mailhog: |
| 134 | + image: mailhog/mailhog |
| 135 | + environment: |
| 136 | + SMTP_HOST: ${AUTH_SMTP_HOST:-mailhog} |
| 137 | + SMTP_PORT: ${AUTH_SMTP_PORT:-1025} |
| 138 | + SMTP_PASS: ${AUTH_SMTP_PASS:-password} |
| 139 | + SMTP_USER: ${AUTH_SMTP_USER:-user} |
| 140 | + SMTP_SECURE: "${AUTH_SMTP_SECURE:-false}" |
| 141 | + SMTP_SENDER: ${AUTH_SMTP_SENDER:[email protected]} |
| 142 | + ports: |
| 143 | + - ${AUTH_SMTP_PORT:-1025}:1025 |
| 144 | + - 8025:8025 |
| 145 | + volumes: |
| 146 | + - ./data/mailhog:/maildir |
| 147 | +volumes: |
| 148 | + functions_node_modules: |
0 commit comments