Skip to content

Commit a1514c3

Browse files
authored
Merge pull request #2 from darjeeling/main
init
2 parents b32a878 + ad8a1d0 commit a1514c3

File tree

6 files changed

+74
-8
lines changed

6 files changed

+74
-8
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
FROM python:3.12-slim-bookworm
22
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
33

4-
ENV PYTHONUNBUFFERED 1
4+
# set environment variables
5+
ENV PYTHONDONTWRITEBYTECODE=1
6+
ENV PYTHONUNBUFFERED=1
57

68
WORKDIR /app
79

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.8'
2-
31
services:
42
db:
53
image: postgres:16
@@ -14,11 +12,13 @@ services:
1412
build: .
1513
command: /app/entroypoint.sh
1614
ports:
17-
- "8000:8000"
15+
- "8080:8080"
1816
depends_on:
1917
- db
2018
environment:
21-
- DATABASE_URL=postgres://pk:mypassword@db:5432/mydatabase
19+
POSTGRES_DB: pk
20+
POSTGRES_USER: pk
21+
POSTGRES_PASSWORD: pktesting
2222

2323
volumes:
2424
postgres_data:

entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ cd /app/pythonkr_backend
77
export DJANGO_SETTINGS_MODULE="pythonkr_backend.settings.localtesting"
88
./manage.py migrate --no-input
99
./manage.py collectstatic --clear --noinput
10+
export DJANGO_SUPERUSER_PASSWORD=test
11+
./manage.py createsuperuser --username test --email [email protected] --noinput
1012
gunicorn --workers=2 \
1113
-b :8080 \
1214
--access-logfile - \

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies = [
99
"gunicorn>=23.0.0",
1010
"httpx>=0.28.1",
1111
"markdown>=3.7",
12-
"psycopg>=3.2.5",
12+
"psycopg[binary]>=3.2.5",
1313
"wagtail>=6.4.1",
1414
"wagtail-bakery>=0.8.0",
1515
]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from pathlib import Path
2+
import os
3+
4+
from .base import *
5+
6+
DATABASES = {
7+
'default': {
8+
'ENGINE': 'django.db.backends.postgresql',
9+
'HOST': 'db',
10+
'NAME': 'pk',
11+
'USER': 'pk',
12+
'PASSWORD': 'pktesting',
13+
}
14+
}
15+
16+
#CSRF_TRUSTED_ORIGINS = ["https://pk.iz4u.net"]
17+
18+
19+
# wagtail
20+
21+
STATIC_ROOT = "/app/static"
22+
23+
MEDIA_ROOT = "/app/media"
24+
25+
# bakery
26+
27+
BAKERY_MULTISITE = True
28+
BUILD_DIR = os.path.join("/app/bakery_static", "build")

uv.lock

Lines changed: 36 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)