Extend docker-compose.yml to provide a complete dev setup
This commit is contained in:
parent
6564503855
commit
4c0dc9e10e
|
@ -0,0 +1,17 @@
|
||||||
|
FROM python:3.10-alpine3.17
|
||||||
|
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
|
RUN adduser -h /home/shiftregister -D shiftregister
|
||||||
|
|
||||||
|
USER shiftregister
|
||||||
|
WORKDIR /home/shiftregister
|
||||||
|
|
||||||
|
ENV PATH="$PATH:/home/shiftregister/.local/bin"
|
||||||
|
|
||||||
|
COPY requirements.txt ./
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
WORKDIR /opt/shiftregister
|
||||||
|
|
||||||
|
EXPOSE 8000
|
|
@ -2,15 +2,58 @@
|
||||||
|
|
||||||
services:
|
services:
|
||||||
broker:
|
broker:
|
||||||
container_name: shiftregister_broker
|
|
||||||
image: rabbitmq:3-alpine
|
image: rabbitmq:3-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- dev
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:5672:5672
|
- 127.0.0.1:5672:5672
|
||||||
|
|
||||||
result_backend:
|
result-backend:
|
||||||
container_name: shiftregister_result_backend
|
|
||||||
image: redis:6-alpine
|
image: redis:6-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- dev
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:6379:6379
|
- 127.0.0.1:6379:6379
|
||||||
|
|
||||||
|
server:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-dev
|
||||||
|
image: shiftregister:dev
|
||||||
|
restart: unless-stopped
|
||||||
|
command:
|
||||||
|
- python
|
||||||
|
- manage.py
|
||||||
|
- runserver
|
||||||
|
- 0.0.0.0:8000
|
||||||
|
environment: &celery
|
||||||
|
CELERY_BROKER_URL: amqp://guest:guest@broker:5672//
|
||||||
|
CELERY_RESULT_BACKEND: redis://result-backend
|
||||||
|
networks:
|
||||||
|
- dev
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:8000:8000
|
||||||
|
volumes:
|
||||||
|
- .:/opt/shiftregister
|
||||||
|
|
||||||
|
worker:
|
||||||
|
image: shiftregister:dev
|
||||||
|
restart: unless-stopped
|
||||||
|
command:
|
||||||
|
- celery
|
||||||
|
- -A
|
||||||
|
- shiftregister
|
||||||
|
- worker
|
||||||
|
- -B
|
||||||
|
- -l
|
||||||
|
- DEBUG
|
||||||
|
environment: *celery
|
||||||
|
networks:
|
||||||
|
- dev
|
||||||
|
volumes:
|
||||||
|
- .:/opt/shiftregister
|
||||||
|
|
||||||
|
networks:
|
||||||
|
dev:
|
||||||
|
|
Loading…
Reference in New Issue