Add Docker support with Dockerfile and docker-compose; implement entrypoint script for application startup
This commit is contained in:
parent
2c0e7b7699
commit
b12f151b8d
3 changed files with 30 additions and 3 deletions
|
@ -10,9 +10,8 @@ USER nummi
|
|||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV NUMMI_CONFIG=/nummi/config.toml
|
||||
|
||||
RUN uv sync --locked
|
||||
|
||||
WORKDIR /app/nummi
|
||||
|
||||
CMD ["uv", "run", "gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "nummi.wsgi:application"]
|
||||
CMD ["./entrypoint.sh"]
|
||||
|
|
23
compose.yaml
Normal file
23
compose.yaml
Normal file
|
@ -0,0 +1,23 @@
|
|||
services:
|
||||
nummi:
|
||||
image: code.edgarpierre.fr/edpibu/nummi:main
|
||||
container_name: nummi
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 33001:8000
|
||||
volumes:
|
||||
- /docker/nummi/config:/nummi
|
||||
- /docker/nummi/static:/app/static
|
||||
- /docker/nummi/media:/app/media
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
container_name: nummi_postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: nummi
|
||||
POSTGRES_PASSWORD:
|
||||
volumes:
|
||||
- /docker/nummi/postgres:/var/lib/postgresql/data
|
5
entrypoint.sh
Normal file
5
entrypoint.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env sh
|
||||
cd nummi
|
||||
uv run manage.py collectstatic --noinput
|
||||
uv run manage.py migrate --noinput
|
||||
uv run gunicorn --bind :8000 --workers 2 nummi.wsgi:application
|
Loading…
Add table
Add a link
Reference in a new issue