forked from coordinape/coordinape
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
122 lines (115 loc) · 3.96 KB
/
docker-compose.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
version: '3.6'
services:
postgres:
image: postgres:13
restart: always
volumes:
- db_data:/var/lib/postgresql/data
ports:
- ${LOCAL_POSTGRES_PORT}:${LOCAL_POSTGRES_PORT}
environment:
POSTGRES_PASSWORD: ${LOCAL_POSTGRES_PASSWORD}
# Hasura
graphql-engine:
image: hasura/graphql-engine:v2.1.1.cli-migrations-v3
volumes:
- ./hasura/migrations:/hasura-migrations
- ./hasura/metadata:/hasura-metadata
ports:
- ${LOCAL_HASURA_PORT}:${LOCAL_HASURA_PORT}
depends_on:
- postgres
restart: always
environment:
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://${LOCAL_POSTGRES_USER}:${LOCAL_POSTGRES_PASSWORD}@postgres:${LOCAL_POSTGRES_PORT}/${LOCAL_POSTGRES_DATABASE}
HASURA_GRAPHQL_DATABASE_URL: postgres://${LOCAL_POSTGRES_USER}:${LOCAL_POSTGRES_PASSWORD}@postgres:${LOCAL_POSTGRES_PORT}/${LOCAL_POSTGRES_DATABASE}
HASURA_GRAPHQL_ENABLE_CONSOLE: 'true'
HASURA_GRAPHQL_DEV_MODE: 'true'
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
HASURA_EVENT_SECRET: ${HASURA_EVENT_SECRET}
# Linux (read: non macOS or Windows) users should
# `export DOCKER_GATEWAY_HOST=172.17.0.1` to interact with the host machine's ports
HASURA_API_BASE_URL: http://${DOCKER_GATEWAY_HOST:-host.docker.internal}:${LOCAL_VERCEL_PORT}/api/hasura
HASURA_GRAPHQL_AUTH_HOOK: http://${DOCKER_GATEWAY_HOST:-host.docker.internal}:${LOCAL_VERCEL_PORT}/api/hasura/auth
## HASURA_GRAPHQL_UNAUTHORIZED_ROLE: public
# for local s3 storage for images
localstack:
image: localstack/localstack:latest
hostname: s3
networks:
default:
aliases:
- s3.localhost.localstack.cloud
- s3-website.localhost.localstack.cloud
- coordinape.s3.localhost.localstack.cloud
- coordinape.s3-website.localhost.localstack.cloud
environment:
- HOSTNAME_EXTERNAL=localstack
- AWS_DEFAULT_REGION=us-east-1
- EDGE_PORT=4566
- SERVICES=s3
- DATA_DIR=/tmp/localstack/data
ports:
- '4566-4583:4566-4583'
volumes:
- '${TEMPDIR:-/tmp/localstack}:/tmp/localstack'
- '/var/run/docker.sock:/var/run/docker.sock'
- ./docker/localstack/docker-entrypoint-initaws.d:/docker-entrypoint-initaws.d
app:
build:
context: ./laravel
dockerfile: ./Dockerfile
container_name: laravel
restart: unless-stopped
tty: true
environment:
SERVICE_NAME: app
DB_CONNECTION: pgsql
DB_HOST: postgres
DB_PORT: ${LOCAL_POSTGRES_PORT}
DB_DATABASE: ${LOCAL_POSTGRES_DATABASE}
DB_USERNAME: ${LOCAL_POSTGRES_USER}
DB_PASSWORD: ${LOCAL_POSTGRES_PASSWORD}
FILESYSTEM_DRIVER: s3
AWS_ACCESS_KEY_ID: dontworry #we have to put some value in here or it tries to use local ec2 metadata auth
AWS_SECRET_ACCESS_KEY: thisisfine #we have to put some value in here or it tries to use local ec2 metadata auth
AWS_ENDPOINT: http://s3.localhost.localstack.cloud:4566
AWS_DEFAULT_REGION: us-east-1
AWS_BUCKET: coordinape
AWS_URL: http://localhost:4566
volumes:
- ./laravel:/var/www
- ./laravel/services/php/local.ini:/usr/local/etc/php/conf.d/local.ini
networks:
- default
depends_on:
- graphql-engine
- localstack
nginx:
container_name: nginx
build:
context: ./laravel
dockerfile: Dockerfile-nginx
args:
# override the defaults in the dockerfile here
# for resolving permissions issues w volumes
nginx_uid: 1000
nginx_gid: 1000
restart: unless-stopped
tty: true
ports:
- ${LOCAL_LARAVEL_PORT}:80
- '443:443'
volumes:
- ./laravel:/var/www
- ./laravel/services/nginx/conf.d/:/etc/nginx/conf.d/
networks:
- default
depends_on:
- app
networks:
default:
driver: bridge
volumes:
db_data: null