-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
71 lines (60 loc) · 1.98 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
FROM python:3.11-bookworm
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash && \
apt-get install -y --install-suggests \
build-essential \
git \
locales \
libpq-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
nginx \
python3-dev \
sudo \
supervisor \
poppler-utils \
nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
dpkg-reconfigure locales && \
locale-gen C.UTF-8 && \
/usr/sbin/update-locale LANG=C.UTF-8 && \
mkdir /etc/venueless && \
mkdir -p /venueless/webapp && \
mkdir /data && \
useradd -ms /bin/bash -d /venueless -u 15371 venueless && \
echo 'venueless ALL=(ALL) NOPASSWD:SETENV: /usr/bin/supervisord' >> /etc/sudoers && \
mkdir /static
ENV LC_ALL=C.UTF-8 \
DJANGO_SETTINGS_MODULE=venueless.settings \
IPYTHONDIR=/data/.ipython
# To copy only the requirements files needed to install from PIP
COPY server/requirements.txt /requirements.txt
RUN pip3 install -U pip wheel setuptools && \
pip3 install -Ur /requirements.txt ipython && \
rm -rf ~/.cache/pip
COPY prod/entrypoint.bash /usr/local/bin/venueless
COPY prod/supervisord.conf /etc/supervisord.conf
COPY prod/nginx.conf /etc/nginx/nginx.conf
RUN chmod +x /usr/local/bin/venueless
COPY webapp/.* /venueless/webapp/
COPY webapp/*.js /venueless/webapp/
COPY webapp/*.json /venueless/webapp/
COPY webapp/src/ /venueless/webapp/src/
COPY webapp/public/ /venueless/webapp/public/
RUN cd /venueless/webapp && \
npm ci --legacy-peer-deps && \
NODE_OPTIONS=--openssl-legacy-provider npm run build && \
mkdir -p data && \
cd .. && \
chown -R venueless:venueless /venueless /data
COPY server /venueless/server
WORKDIR /venueless/server
RUN python manage.py collectstatic
ARG COMMIT=""
LABEL commit=${COMMIT}
ENV VENUELESS_COMMIT_SHA=${COMMIT}
USER venueless
VOLUME ["/etc/venueless", "/data"]
EXPOSE 80
CMD ["all"]