Files
penracourses/docker/docker-compose.yml
T

53 lines
1.5 KiB
YAML

services:
redis:
image: redis:7.4.2-alpine
expose:
- 6379
volumes:
- ./redis/redis.conf:/usr/local/etc/redis/redis.conf
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
web:
build:
# Use the rad/ directory as the build context and the Dockerfile inside it.
# This avoids relative path issues with different docker/compose versions and buildx.
context: ./rad
dockerfile: Dockerfile
command: python manage.py runserver 0.0.0.0:8000
#command: pip install -r requirements.txt
volumes:
# Mount the rad app directory into the container WORKDIR used by the Dockerfile
- ./rad:/usr/src/rad
# Mount host media/static/backups into sensible container paths
- ./backups:/usr/src/rad/backups
- ./media:/usr/src/rad/media
- ./static:/usr/src/rad/static
ports:
- 8000:8000
- 3459:3459
env_file:
- ./.env.dev
db:
image: postgres:14.2-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=django
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=rad
pgadmin:
image: dpage/pgadmin4:7.2
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL:-admin@local}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD:-admin}
ports:
- 8080:80
volumes:
- pgadmin_data:/var/lib/pgadmin
cache:
image: memcached
ports:
- 11211:11211
volumes:
postgres_data:
pgadmin_data: