-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.cloudsql.prod.yml
48 lines (44 loc) · 1.34 KB
/
docker-compose.cloudsql.prod.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
# docker compose --env-file .cloudsql_env -f docker-compose.cloudsql.yml -p cgcloudsql build
# docker compose --env-file .cloudsql_env -f docker-compose.cloudsql.yml -p cgcloudsql up -d
version: "3.7"
services:
server:
build:
context: ./
dockerfile: ./services/server/prod.Dockerfile
args:
CONFIGFILE: ${CONFIGFILE}
environment:
- LOGINS=user1:pass1,user2:pass2
# - FLASK_APP=cg_server/main.py
- FLASK_ENV=production
- CLOUDSQL_CONNECTION_NAME
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_HOST
- POSTGRES_MAX_CONN=20
command: "gunicorn --bind :8080 --workers 1 --threads 8 --timeout 0 cg_server.main:app"
# command: "flask run --host 0.0.0.0 --port=8080"
ports:
- 8080:8080
working_dir: /app
volumes:
# Mount the volume for the cloudsql proxy.
- cloudsql:/cloudsql
depends_on:
- sql_proxy
sql_proxy:
image: gcr.io/cloudsql-docker/gce-proxy:1.19.1
command:
- "/cloud_sql_proxy"
- "-dir=/cloudsql"
- "-instances=${CLOUDSQL_CONNECTION_NAME}"
- "-credential_file=/tmp/keys/keyfile.json"
# Allow the container to bind to the unix socket.
user: root
volumes:
- ${GOOGLE_APPLICATION_CREDENTIALS}:/tmp/keys/keyfile.json:ro
- cloudsql:/cloudsql
volumes:
cloudsql: