How to add hasura settings to an existing docker-compose.yaml to group it with other related project containers? #7192
-
Hello, I have a Laravel project with docker (Laravel Sail) and postgres... how can i just add hasura in this project's In this case, the laravel Project already have some specific docker settings, like its own dependencias and volumes and i just want to add it to be grouped inside the same container group in docker desktop: Below the current projects version: '3'
services:
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.0
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.0/app
ports:
- '${APP_PORT:-80}:80'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- pgsql
- redis
pgsql:
image: 'postgres:13'
ports:
- '${FORWARD_DB_PORT:-5432}:5432'
environment:
PGPASSWORD: '${DB_PASSWORD:-secret}'
POSTGRES_DB: '${DB_DATABASE}'
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
volumes:
- 'sailpgsql:/var/lib/postgresql/data'
networks:
- sail
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "${DB_DATABASE}", "-U", "${DB_USERNAME}"]
retries: 3
timeout: 5s
redis:
image: 'redis:alpine'
ports:
- '${FORWARD_REDIS_PORT:-6379}:6379'
volumes:
- 'sailredis:/data'
networks:
- sail
healthcheck:
test: ["CMD", "redis-cli", "ping"]
retries: 3
timeout: 5s
mailhog:
image: 'mailhog/mailhog:latest'
ports:
- '${FORWARD_MAILHOG_PORT:-1025}:1025'
- '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
networks:
- sail
networks:
sail:
driver: bridge
volumes:
sailpgsql:
driver: local
sailredis:
driver: local |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found it.
graphql-engine:
image: hasura/graphql-engine:v2.0.1
ports:
- '${FORWARD_HASURA_PORT:-8080}:8080'
depends_on:
- "pgsql"
volumes:
- 'sailhasura:/data'
networks:
- sail
restart: always
environment:
HASURA_GRAPHQL_METADATA_DATABASE_URL: "postgres://${DB_USERNAME}:${DB_PASSWORD}@pgsql:5432/${DB_DATABASE}"
## enable the console served by server
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
## enable debugging mode. It is recommended to disable this in production
HASURA_GRAPHQL_DEV_MODE: "true"
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
## uncomment next line to set an admin secret
# HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey
...
sailhasura:
driver: local Now i can replicate the repo in another machine by running hasura with the Laravel project just by run the stuffs... It's my first interactions with hasura by handling directly with docker... Amazing! Hasura is so cool! |
Beta Was this translation helpful? Give feedback.
Found it.
graphql-engine
block from original hasura docker-compose.yamldepends_on
part to match Postgres service name