-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
56 lines (54 loc) · 1.46 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
services:
python:
#build:
# context: ./.docker/python
# args:
# PY_VERSION: ${PY_VERSION}
container_name: ${NAMESPACE}_python
image: osioaliu/python:${PY_VERSION}
tty: true
init: true
depends_on:
- postgres
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- TZ=${TZ}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_TABLE=${POSTGRES_TABLE}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
working_dir: /src
command: >
/bin/bash -c "
pip install --upgrade pip &&
pip install -r requirements.txt &&
crond -f &&
tail -f /dev/null"
volumes:
- ./src:/src
postgres:
container_name: ${NAMESPACE}_postgres
image: postgres:${POSTGRES_VERSION}
environment:
- TZ=${TZ}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_TABLE=${POSTGRES_TABLE}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- PG'options'='max_connections=10,enable_parallel_queries=true'
ports:
- "${POSTGRES_PORT}:5432"
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}
interval: 5s
retries: 5
start_period: 10s
volumes:
pg_data: