last commit before dropping the idea of multi-stage builds

This commit is contained in:
Walter 2025-02-20 19:47:53 +01:00
parent d0acd97618
commit ef004ded24
5 changed files with 12 additions and 11 deletions

View File

@ -5,5 +5,5 @@ SQL_ENGINE=django.db.backends.postgresql
SQL_DATABASE=bloonsworld
SQL_USER=bloonsworld
SQL_PASSWORD=password123
SQL_HOST=db
SQL_HOST=bloonsworld-db
SQL_PORT=5432

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ venv
.env
*.sqlite3
*.db
docker-compose.yml

View File

@ -1,6 +1,6 @@
# https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/
FROM python:3.12.2-slim-buster as builder
FROM python:3.13.2-slim-bullseye AS builder
WORKDIR /usr/src/app
@ -14,13 +14,13 @@ RUN apt-get update && \
pip install flake8==6.0.0
COPY . /usr/src/app/
RUN flake8 --ignore=E501,F401 .
# RUN flake8 --ignore=E501,F401 .
COPY ./requirements.txt .
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt
FROM python:3.12.2-alpine3.21
FROM python:3.13.2-alpine3.21
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
@ -31,7 +31,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
RUN mkdir -p $HOME && \
mkdir $APP_HOME && \
addgroup --system app && \
adduser --system --group app
adduser --system -G app app
WORKDIR $APP_HOME

View File

@ -3,7 +3,7 @@ django-crispy-forms==2.3
crispy-bootstrap4==2024.10
django-extensions==3.2.3
tqdm==4.67.1
Pillow==11.1.0
Pillow==11.*
django-resized==1.0.3
django-cleanup==9.0.0
psycopg2-binary==2.9.10

View File

@ -2,9 +2,9 @@ services:
bloonsworld:
build: ./app
volumes:
- ./.media:/app/media:ro
- ./.static:/app/static:rw
- ./.django:/app/data:rw
- ./.data/media:/app/media:ro
- ./.data/static:/app/static:rw
- ./.data/django:/app/data:rw
command:
- sh
- -c
@ -23,7 +23,7 @@ services:
bloonsworld-db:
image: postgres:17
volumes:
- postgres_data:/var/lib/postgresql/data/
- ./.data/postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=$SQL_USER
- POSTGRES_PASSWORD=$SQL_PASSWORD