forked from Sefaria/Sefaria-Project
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
72 lines (54 loc) · 2.08 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Use node-python image as the base image
FROM beevk/node-python:0.2
# Set the working directory inside the container
WORKDIR /app
# Copy the local_settings.py file to the working directory
COPY ./sefaria/local_settings.py ./sefaria/local_settings.py
# Copy the requirements.txt file and install dependencies
COPY requirements.txt ./
COPY package*.json ./
# Install global Python and Node.js dependencies
RUN pip install -r requirements.txt
RUN npm install --unsafe-perm
# compile django inbuild po hebrew translation
# RUN msgfmt /usr/local/bin/python/site-packages/django/contrib/auth/locale/he/LC_MESSAGES/django.po -o /usr/local/bin/python/site-packages/django/contrib/auth/locale/he/LC_MESSAGES/django.mo
# Check the installed version of Pillow after installing requirements
RUN python -m pip show Pillow
COPY ./node ./node
COPY ./static/js ./static/js
RUN npm run setup
RUN npm run build-prod
# Install system dependencies for building Python 3.12
# RUN apt-get update && apt-get install -y \
# software-properties-common \
# wget \
# build-essential \
# zlib1g-dev \
# libssl-dev \
# libbz2-dev \
# libreadline-dev \
# libsqlite3-dev \
# libffi-dev && \
# apt-get clean
# Download and build Python 3.12
# RUN wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz && \
# tar xvf Python-3.12.0.tgz && \
# cd Python-3.12.0 && \
# ./configure --enable-optimizations && \
# make -j$(nproc) && \
# make altinstall && \
# cd .. && rm -rf Python-3.12.0 Python-3.12.0.tgz
# Verify Python 3.12 installation
# RUN python3.12 --version
# Create a virtual environment with Python 3.12
# RUN python3.12 -m venv /pillow-env && \
# /pillow-env/bin/pip install --upgrade pip && \
# /pillow-env/bin/pip install Pillow==11.0.0
# RUN /pillow-env/bin/pip list
# RUN ls -l /pillow-env/lib/python3.12/site-packages
# Copy application source code
COPY . ./
# Run Django migrations and start the server
CMD ["bash", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"]
# Expose the port for the Django application
EXPOSE 8000