-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
52 lines (37 loc) · 1.53 KB
/
Dockerfile
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Base Docker image Official Python 3.10
FROM python:3.12
# Set 'build-time' environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Setup GDAL + PILLOW required for CAPTCHA
RUN apt-get update &&\
apt-get install -y binutils libproj-dev gdal-bin libgdal-dev python3-gdal &&\
apt-get install -y libz-dev libjpeg-dev libfreetype6-dev\
&& apt-get install -y nodejs npm
# Extra packages required for Material for MkDocs plugins (dependency for git and pdf plugins)
RUN apt install -y git python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0
# Add requirements
COPY requirements/requirements.txt /app/requirements/requirements.txt
# Set working directory for requirements installation
WORKDIR /app/requirements/
# Run installation of requirements
RUN pip install --upgrade pip
RUN pip install -r /app/requirements/requirements.txt
# Set safe working directory for git
RUN git config --global --add safe.directory /app
# Set working directory back to main app
WORKDIR /app/
# Copy application code into image
# (Excludes any files/dirs matched by patterns in .dockerignore)
COPY . /app/
# Ensure the media directory exists - csv files are stored here
RUN mkdir -p /media/submissions/csv/
# Install Tailwind CSS and DaisyUI
RUN npm install
# Set correct permissions for npm directories using root user
RUN chown -R root:root /app/node_modules
RUN chmod -R 755 /app/node_modules
# Build Tailwind CSS
RUN npm run build:css
# Collect and compress static files into image
RUN python manage.py collectstatic --no-input