-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
44 lines (36 loc) · 1 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
FROM python:3.11 as buildimage
COPY . /tmp/app_install
RUN set -eux; \
# wheel all packages for habapp
cd /tmp/app_install; \
pip wheel --wheel-dir=/root/wheels .
FROM python:3.11
COPY --from=buildimage /root/wheels /root/wheels
COPY container/entrypoint.sh /entrypoint.sh
ENV HABAPP_HOME=/habapp \
USER_ID=9001 \
GROUP_ID=${USER_ID}
RUN set -eux; \
# Install required dependencies
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
gosu \
tini; \
ln -s -f $(which gosu) /usr/local/bin/gosu; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*; \
mkdir -p ${HABAPP_HOME}; \
mkdir -p ${HABAPP_HOME}/config; \
# install HABApp
pip3 install \
--no-index \
--find-links=/root/wheels \
habapp; \
# prepare entrypoint script
chmod +x /entrypoint.sh; \
# clean up
rm -rf /root/wheels
WORKDIR ${HABAPP_HOME}
VOLUME ["${HABAPP_HOME}/config"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["gosu", "habapp", "tini", "--", "python", "-m", "HABApp", "--config", "./config"]