Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
.env
.env.*
.venv
**/__pycache__
**/*.sqlite3
web/private_media
web/staticfiles
work
2 changes: 0 additions & 2 deletions .env

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
44 changes: 44 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: HIMP Web
on:
push:
pull_request:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: himp
POSTGRES_USER: himp
POSTGRES_PASSWORD: ci-only-password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready --health-interval 10s
--health-timeout 5s --health-retries 5
env:
DJANGO_DEBUG: "true"
DATABASE_URL: postgres://himp:ci-only-password@localhost:5432/himp
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: requirements-web.txt
- run: pip install -r requirements-web.txt
- run: python web/manage.py makemigrations --check --dry-run
- run: python web/manage.py migrate --noinput
- run: python web/manage.py bootstrap_roles
- run: python web/manage.py collectstatic --noinput
- run: python web/manage.py test office --verbosity 2
- name: Production settings checks
env:
DJANGO_DEBUG: "false"
DJANGO_SECRET_KEY: ci-only-placeholder-long-enough-for-security-checks-1234567890
DJANGO_ALLOWED_HOSTS: himp.example.com
DJANGO_CSRF_TRUSTED_ORIGINS: https://himp.example.com
run: python web/manage.py check --deploy --fail-level WARNING
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.env
.env.*
!.env.example
__pycache__/
*.py[cod]
.venv/
*.sqlite3
web/private_media/
web/staticfiles/
credentials*.json
token*.json
*.zip
.pytest_cache/
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.13-slim
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 DJANGO_DEBUG=false
WORKDIR /app
COPY requirements-web.txt ./
RUN pip install --no-cache-dir -r requirements-web.txt
COPY web/ ./
RUN DJANGO_DEBUG=true python manage.py collectstatic --noinput \
&& groupadd --gid 10001 himp \
&& useradd --uid 10001 --gid himp --no-create-home himp \
&& mkdir -p private_media && chown himp:himp private_media
USER himp
EXPOSE 8000
CMD ["gunicorn", "himp.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "2", "--timeout", "60", "--access-logfile", "-"]
Loading
Loading