forked from TrangPham/django-admin-confirm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.dev.yml
56 lines (53 loc) · 1.67 KB
/
docker-compose.dev.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
version: "3.9"
services:
web:
build:
context: .
dockerfile: Dockerfile
args:
PYTHON_VERSION: "$PYTHON_VERSION"
DJANGO_VERSION: "$DJANGO_VERSION"
SELENIUM_VERSION: "$SELENIUM_VERSION"
# Note: collectstatic runs from inside the docker container and needs
# to access localstack through the host machine using host.docker.internal
# BUT when we access the django server from our host machine, we need to access
# the stored staticfiles via localhost, so export LOCALSTACK_HOST before and after
command: >
sh -c "export LOCALSTACK_HOST=host.docker.internal &&
python tests/manage.py collectstatic --no-input &&
export LOCALSTACK_HOST=localhost &&
python tests/manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- selenium
- localstack
environment:
- LOCALSTACK_HOST=host.docker.internal
- SELENIUM_HOST=host.docker.internal
selenium:
image: selenium/standalone-firefox
ports:
- "4444:4444" # Selenium
- "5900:5900" # VNC
volumes:
- .:/code
localstack:
image: localstack/localstack
ports:
- "4566:4566"
- "4571:4571"
environment:
- SERVICES=s3
- DEBUG=true
# enable persistance
- PERSISTENCE=1
- LAMBDA_EXECUTOR=docker
- DOCKER_HOST=unix:///var/run/docker.sock
- HOSTNAME_EXTERNAL=localstack
volumes:
- "./docker-entrypoint-initaws.d:/docker-entrypoint-initaws.d"
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"