File tree Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM python:3.12-slim-bookworm
2
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
3
+
4
+ ENV PYTHONUNBUFFERED 1
5
+
6
+ WORKDIR /app
7
+
8
+ # Copy the project into the image
9
+ ADD . /app
10
+
11
+ # Delete .sqlite3 files
12
+ RUN find /app -name "*.sqlite3" -delete
13
+
14
+ # Sync the project into a new environment, using the frozen lockfile
15
+ RUN uv sync --frozen
16
+
17
+ ENTRYPOINT [ "/app/entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ version : ' 3.8'
2
+
3
+ services :
4
+ db :
5
+ image : postgres:16
6
+ environment :
7
+ POSTGRES_DB : pk
8
+ POSTGRES_USER : pk
9
+ POSTGRES_PASSWORD : pktesting
10
+ volumes :
11
+ - postgres_data:/var/lib/postgresql/data
12
+
13
+ web :
14
+ build : .
15
+ command : /app/entroypoint.sh
16
+ ports :
17
+ - " 8000:8000"
18
+ depends_on :
19
+ - db
20
+ environment :
21
+ - DATABASE_URL=postgres://pk:mypassword@db:5432/mydatabase
22
+
23
+ volumes :
24
+ postgres_data:
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+
4
+ cd /app
5
+ source .venv/bin/activate
6
+ cd /app/pythonkr_backend
7
+ export DJANGO_SETTINGS_MODULE=" pythonkr_backend.settings.localtesting"
8
+ ./manage.py migrate --no-input
9
+ ./manage.py collectstatic --clear --noinput
10
+ gunicorn --workers=2 \
11
+ -b :8080 \
12
+ --access-logfile - \
13
+ --error-logfile - \
14
+ pythonkr_backend.wsgi
You can’t perform that action at this time.
0 commit comments