This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM base AS production | |
# Let's allow .pycs again | |
ENV PYTHONDONTWRITEBYTECODE=0 | |
# Needed to compile uwsgi, clean up after | |
RUN --mount=type=cache,target=/var/cache/apt apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential \ | |
python3-dev \ | |
libpcre3-dev \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream django_rik_proovitoo { | |
server unix:///home/rik/rik_proovitöö/run/app.sock; | |
} | |
server { | |
listen 443 ssl http2; | |
listen [::]:443 ssl http2; | |
server_name rik.indoorsman.ee; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rik_proovitoo_prod: | |
profiles: ["prod"] | |
build: | |
context: . | |
target: production | |
image: laurielias/rik_proovitoo:latest | |
container_name: rik_proovitoo_prod | |
volumes: | |
- ./run:/home/docker/rik_proovitöö/run | |
environment: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
python manage.py migrate --noinput | |
case "$DJANGO_ENV" in | |
"development") | |
python manage.py loaddata rik_proovitöö/fixtures/superuser.json | |
python manage.py loaddata rik_proovitöö/fixtures/legal_entity.json | |
python manage.py loaddata rik_proovitöö/fixtures/equity.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
postgres: | |
profiles: ["dev", "test", "prod"] | |
image: postgres:16-alpine | |
container_name: rik_proovitoo_postgres | |
ports: | |
- '5432:5432' | |
environment: | |
- POSTGRES_DB=rik_proovitöö | |
- POSTGRES_USER=rik_proovitöö |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM base AS development | |
# Django's built-in development server | |
EXPOSE 8000 | |
COPY requirements.test.txt pytest.ini ./ | |
RUN --mount=type=cache,target=/root/.cache/pip pip install --no-cache-dir -r requirements.test.txt \ | |
&& rm -rf requirements.test.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.12-slim AS base | |
LABEL maintainer="Lauri Elias <laurileet@gmail.com>" | |
# So we'd never have a stuck build waiting for input | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Waste of microseconds, I trust the base image to be up to date | |
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 | |
# So the very last log entry before a crash would be recorded |