forked from larsderidder/docker-compose-development-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev-python.yml
61 lines (57 loc) · 2.34 KB
/
docker-compose.dev-python.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
version: '2'
services:
python:
image: registry.gitlab.com/mycompany/myproject/python:dev
# Without "volumns", the contents of the python subdirectory ("/code" in Dockerfile) will be added to the container.
# If a change is made on the host machine, the container has to be rebuild before we see those changes in the container.
# But with "volumns", any changes you make will immediately be reflected inside the container.
volumes:
- ./python/:/code
# here watchmedo is a part of "watchdog" package, which rebuild (execute "mypackage/run.py") automatically if any change is made in "*.py".
entrypoint: watchmedo auto-restart --recursive --pattern="*.py" --directory="." python mypackage/run.py
# depends_on:
# - postgres
# links:
# - postgres
# environment:
# - POSTGRES_USER=user
# - POSTGRES_PASSWORD=password
# - POSTGRES_DB=myproject
# - POSTGRES_HOST=postgres
python-tests:
image: registry.gitlab.com/mycompany/myproject/python:dev # the same image with python -> the image will only be built once.
volumes:
- ./python/:/code
# this entrypoint means that all unittest (written in pytest) will be triggered whenever there is any modification in "*.py".
entrypoint: watchmedo auto-restart --recursive --pattern="*.py" --directory="." pytest
# "depend_on" notices to docker-composer to build "python" service first before building "python-tests" service.
depends_on:
- python
# java:
# image: registry.gitlab.com/mycompany/myproject/java:dev
# volumes:
# - ./java/:/usr/src/app
# entrypoint: sh -c 'find src/ | entr mvn clean compile exec:java --batch-mode --quiet'
# depends_on:
# - postgres
# links:
# - postgres
# environment:
# - POSTGRES_USER=user
# - POSTGRES_PASSWORD=password
# - POSTGRES_DB=myproject
# - POSTGRES_HOST=postgres
# postgres:
# image: postgres:9.6
# # This hard-coded env variables can be passed from an external source in the production situation.
# environment:
# - POSTGRES_USER=user
# - POSTGRES_PASSWORD=password
# - POSTGRES_DB=myproject
# # map Postgres DB data to a location on your host machine
# volumes:
# - /data/aedspy/postgres:/var/lib/postgresql/data
pgadminer:
image: clue/adminer
ports:
- "99:80"