-
Notifications
You must be signed in to change notification settings - Fork 38
/
Dockerfile
66 lines (47 loc) · 1.6 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
FROM node as npm
WORKDIR /tmp
COPY package.json package-lock.json /tmp/
RUN npm update -g npm && npm install
COPY . /tmp/
RUN npm run build
# -----------------------------------------------------------------------------
FROM python:3.11-slim-buster
ENV PYTHONPATH=/app/ \
PYTHONHASHSEED=random \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
LANG=C.UTF-8 \
PORT=5000
# add a non-privileged user for installing and running the application
# don't use --create-home option to prevent populating with skeleton files
RUN mkdir /app && \
chown 10001:10001 /app && \
groupadd --gid 10001 app && \
useradd --no-create-home --uid 10001 --gid 10001 --home-dir /app app
RUN set -x \
&& apt-get update \
&& apt-get install locales -y \
&& locale-gen en_US.UTF-8
# install a few essentials and clean apt caches afterwards
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential curl git libpq-dev \
postgresql-client gettext sqlite3 libffi-dev \
inotify-tools wget bzip2 wait-for-it && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pip install -U pip
WORKDIR /app
COPY requirements.txt /app/
RUN pip install -r requirements.txt
COPY . /app/
COPY --from=npm /tmp/node_modules /app/node_modules/
COPY --from=npm /tmp/jazzband/static/dist /app/jazzband/static/dist/
RUN chown -R 10001:10001 /app
USER 10001
EXPOSE 5000
ENTRYPOINT ["/app/docker-entrypoint.sh", "--"]