forked from HackAssistant/registration
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (19 loc) · 756 Bytes
/
Dockerfile
File metadata and controls
25 lines (19 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM python:3.10-alpine
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Upgrade pip before installing dependencies
RUN pip install --upgrade pip
COPY requirements.txt requirements.txt
# Add bin to path to avoid wanring
ENV PATH="/home/biene/.local/bin:${PATH}"
# Disable cache because it won't be used because it will be installed only when creating image
RUN pip install --no-cache-dir -r requirements.txt
# Mounts the application code to the image
COPY . code
WORKDIR /code
# Generate static files in the container
RUN python manage.py collectstatic --noinput
# Add crons from crontab django module to system cron
RUN python manage.py crontab add