Python 3.11, relevant upgrades
[wolnelektury.git] / docker-compose.yml
1 x-app-base: &app-base
2   build:
3     context: .
4     target: deps
5     args:
6       UID: ${UID:-1000}
7       GID: ${GID:-1000}
8   env_file:
9    - .env
10   environment:
11     DEBUG: "True"
12   volumes:
13    - ./src:/app/src
14    - ./scripts:/app/scripts
15    - ./var/media:/app/var/media
16    - ./var/static:/app/var/static
17    - ./var/counters/:/app/var/counters
18    - ${LIBRARIAN:-/nonexistent}:/${LIBRARIAN:+edita}ble/librarian
19    - ipython:/app/.ipython
20    - ./var/.bash_history:/app/.bash_history
21   depends_on:
22    - db
23    - redis
24    - memcached
25   entrypoint: /app/scripts/entrypoint.sh
26
27 services:
28   web:
29     <<: *app-base
30     command: python -Wall ./manage.py runserver 0.0.0.0:8000
31     ports:
32       # Dev: use http://localhost:8000/ directly
33       - "127.0.0.1:8000:8000"
34
35   celery:
36     <<: *app-base
37     command: celery -A wolnelektury worker -l info
38
39   db:
40     build:
41       context: .
42       target: postgres
43     env_file:
44       - .env
45     volumes:
46       - ./var/postgresql-data/:/var/lib/postgresql/
47
48   redis:
49     image: redis:8-alpine
50
51   memcached:
52     image: memcached:1.6-alpine
53
54   nginx:
55     # Just for testing production-like environment.
56     # docker compose --profile nginx up
57     profiles: ["nginx"]
58     build:
59       context: .
60       target: nginx
61       args:
62         UID: ${UID:-1000}
63         GID: ${GID:-1000}
64     ports:
65       - "127.0.0.1:8101:80"
66     volumes:
67       - ./var/media:/app/var/media:ro
68       - ./scripts/nginx.conf:/etc/nginx/conf.d/default.conf:ro
69     depends_on:
70       - web
71
72
73 volumes:
74   ipython: