-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (44 loc) · 1.26 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
53
# Use the official Python image from the Docker Hub
FROM python:3.12-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install build dependencies and curl
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libssl-dev \
libpcre3-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
# Raspberry Pi packages 📦
# RUN apt update && apt install -y \
# libjpeg-dev \
# zlib1g-dev \
# libpng-dev \
# libfreetype6-dev \
# liblcms2-dev \
# libopenjp2-7-dev \
# libtiff5-dev \
# libwebp-dev \
# tcl8.6-dev \
# tk8.6-dev \
# python3-tk \
# libharfbuzz-dev \
# libfribidi-dev
# Set the working directory
WORKDIR /forkapi
# Copy the project
COPY /forkapi /forkapi
COPY ./requirements.txt /forkapi/requirements.txt
# Install dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
RUN playwright install --with-deps chromium
# Collect static files
RUN python manage.py makemigrations authentication
RUN python manage.py makemigrations recipe
RUN python manage.py migrate
RUN python manage.py collectstatic --noinput
# Give permissions around and add www-data to staff
RUN chmod 660 /forkapi/sql/db.sqlite3
RUN usermod -g staff www-data