-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
194 lines (188 loc) · 5.36 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
version: "3"
services:
gateway:
build: .
env_file:
- .env
command: yarn gateway dev
ports:
- $GATEWAY_PORT:$GATEWAY_PORT
volumes:
- .:/paperpod
# node-modules not synced
- /paperpod/node_modules
environment:
- PORT=$GATEWAY_PORT
- WEB_PORT=$WEB_PORT
- DOCS_PORT=$DOCS_PORT
- API_PORT=$API_PORT
- AUTHENTICATION_PORT=$AUTHENTICATION_PORT
- NODE_ENV=dev
- LOG_LEVEL=$LOG_LEVEL
working_dir: /paperpod
api:
build: .
env_file:
- .env
ports:
- $API_PORT:$API_PORT
command: yarn api dev
volumes:
- .:/paperpod
# node-modules not synced
- /paperpod/node_modules
environment:
NODE_ENV: dev
PORT: $API_PORT
# IPC for user subscription check where JWT is not available
AUTHENTICATION_INTERNAL_PORT: $AUTHENTICATION_INTERNAL_PORT
ADMIN_USERNAME: $ADMIN_USERNAME
ADMIN_PASSWORD: $ADMIN_PASSWORD
AUTHENTICATION_PORT: $AUTHENTICATION_PORT
JWT_SECRET: $JWT_SECRET
PGHOST: database
PGDATABASE: $PGDATABASE
PGUSER: $PGUSER
PAPERPOD_SCHEMA: api
PGPASSWORD: $PGPASSWORD
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
LOG_LEVEL: $LOG_LEVEL
working_dir: /paperpod
authentication:
build: .
env_file:
- .env
ports:
- $AUTHENTICATION_PORT:$AUTHENTICATION_PORT
command: yarn authentication dev
volumes:
- .:/paperpod
# node-modules not synced
- /paperpod/node_modules
environment:
NODE_ENV: dev
PORT: $AUTHENTICATION_PORT
# IPC for user subscription check where JWT is not available
INTERNAL_PORT: $AUTHENTICATION_INTERNAL_PORT
ADMIN_USERNAME: $ADMIN_USERNAME
ADMIN_PASSWORD: $ADMIN_PASSWORD
JWT_SECRET: $JWT_SECRET
PGHOST: database
PAPERPOD_SCHEMA: authentication
PGDATABASE: $PGDATABASE
PGUSER: $PGUSER
PGPASSWORD: $PGPASSWORD
STRIPE_API_KEY: $STRIPE_API_KEY
LOG_LEVEL: $LOG_LEVEL
working_dir: /paperpod
web:
build: .
env_file:
- .env
ports:
- $WEB_PORT:$WEB_PORT
command: yarn web dev --port $WEB_PORT
volumes:
- .:/paperpod
# node-modules not synced
- /paperpod/node_modules
environment:
- LOG_LEVEL=$LOG_LEVEL
- NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=$STRIPE_PUBLISHABLE_KEY
working_dir: /paperpod
docs:
build: .
env_file:
- .env
ports:
- $DOCS_PORT:$DOCS_PORT
command: yarn docs dev
volumes:
- .:/paperpod
# node-modules not synced
- /paperpod/node_modules
environment:
- NODE_ENV=dev
- PORT=$DOCS_PORT
- LOG_LEVEL=$LOG_LEVEL
working_dir: /paperpod
extension:
build: .
env_file:
- .env
command: yarn extension dev
volumes:
- ./packages/extension:/paperpod/packages/extension
environment:
- LOG_LEVEL=$LOG_LEVEL
working_dir: /paperpod
# ultrahook.com receives webhook events from Stripe and
# forwards them to my local dev server.
# Stripe does not support localhost as an endpoint, so this is needed.
ultrahook:
build:
dockerfile: ./Dockerfile.ultrahook
context: .
env_file:
- .env
command: ultrahook stripe http://gateway:${GATEWAY_PORT}/authentication/payment/webhook
environment:
- ULTRAHOOK_API_KEY=$ULTRAHOOK_API_KEY
database:
image: postgres:13
command: postgres -N 500
ports:
- $PGPORT:$PGPORT
environment:
- POSTGRES_DB=$PGDATABASE
- POSTGRES_USER=$PGUSER
- POSTGRES_PASSWORD=$PGPASSWORD
# This is here because some TF dependencies don't
# support M1 macs. Use `de infrastructure /bin/sh`
# to use Terraform through this container as a workaround :)
infrastructure:
build:
context: .
dockerfile: ./packages/infrastructure/Dockerfile
volumes:
- ./packages/infrastructure:/infrastructure
env_file:
- .env
# keep it running to enable SSH-ing into it: https://stackoverflow.com/a/45450456/8543529
command: tail -F anything
environment:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
TF_VAR_stripe_api_token: $STRIPE_API_KEY
TF_VAR_stripe_api_key: $STRIPE_API_KEY
TF_VAR_stripe_publishable_key: $STRIPE_PUBLISHABLE_KEY
TF_VAR_test_user_coupon_code: $STRIPE_COUPON_CODE
TF_VAR_do_token: $DO_TOKEN
TF_VAR_github_api_token: $GH_TOKEN
TF_VAR_gateway_port: $GATEWAY_PORT
TF_VAR_web_port: $WEB_PORT
TF_VAR_docs_port: $DOCS_PORT
TF_VAR_api_port: $API_PORT
TF_VAR_authentication_port: $AUTHENTICATION_PORT
TF_VAR_log_level: $LOG_LEVEL
TF_VAR_authentication_internal_port: $AUTHENTICATION_INTERNAL_PORT
TF_VAR_admin_username: $ADMIN_USERNAME
TF_VAR_admin_password: $ADMIN_PASSWORD
TF_VAR_jwt_secret: $JWT_SECRET
TF_VAR_aws_access_key_id: $AWS_ACCESS_KEY_ID
TF_VAR_aws_secret_access_key: $AWS_SECRET_ACCESS_KEY
# metabase:
# image: metabase/metabase
# env_file:
# - .env
# ports:
# - $METABASE_PORT:3000
# environment:
# - MB_DB_TYPE=postgres
# - MB_DB_DBNAME=$PGDATABASE
# - MB_DB_PORT=$PGPORT
# - MB_DB_USER=$PGUSER
# - MB_DB_PASS=$PGPASSWORD
# - MB_DB_HOST=database
# - JAVA_TIMEZONE=Europe/Oslo