-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
63 lines (56 loc) · 1.44 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
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
texlive-latex-recommended \
texlive-fonts-recommended \
texlive-fonts-extra \
texlive-science \
texlive-latex-extra \
texlive-bibtex-extra \
texlive-full \
python3 \
binutils \
plantuml \
wget \
curl \
xvfb \
xauth \
libnss3 \
libxss1 \
libasound2 \
libatk1.0-0 \
libgtk-3-0 \
libx11-xcb1 \
libnotify4 \
libxtst6 \
libsecret-1-0 \
libappindicator3-1 \
fonts-liberation \
libgconf-2-4 \
ca-certificates \
libgbm1 \
libpangocairo-1.0-0 \
libcurl4 \
inkscape \
cron \
git \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Add cron job to pull the repo every minute
RUN echo "* * * * * cd /app/ert_wiki && git pull "git@github.com:EPFLRocketTeam/ert_wiki.git" > /var/log/cron.log 2>&1" > /etc/cron.d/ert_wiki_cron \
&& chmod 0644 /etc/cron.d/ert_wiki_cron \
&& crontab /etc/cron.d/ert_wiki_cron
# Copy application code
COPY ./app .
COPY gunicorn.conf.py .
COPY ./ert_wiki ./ert_wiki
COPY ImageLuaFilter.lua .
COPY ~/.ssh /root/.ssh:ro
# Ensure cron runs in the container
CMD ["sh", "-c", "cron && gunicorn --config gunicorn.conf.py app:app"]
# Expose port 8000 (Gunicorn default)
EXPOSE 8000