-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 1008 Bytes
/
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
FROM python:3.12-slim
WORKDIR /snipinator
# apt-get -y --no-install-recommends install git=1:2.39.2-1.1 &&
# apt-get -y upgrade &&
RUN apt-get -y update && apt-get -y --no-install-recommends install bash=5.2.15-2+b7 && \
apt-get -y clean && \
apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/* && \
useradd -m -d /home/user -s /bin/bash user && \
pip install --no-cache-dir --upgrade pip setuptools wheel && \
mkdir -p /home/user/.local && \
chown -R user:user /snipinator /home/user/.local && \
chmod -R a+wrX /snipinator
COPY --chown=user:user . /snipinator
USER user
WORKDIR /snipinator
ENV PATH=/home/user/.local/bin:$PATH
ENV PYTHONPATH=/home/user/.local/lib/python3.12/site-packages
RUN pip install --no-cache-dir --prefix=/home/user/.local .
# This is where the user will mount their data to.
WORKDIR /data
ENTRYPOINT ["python", "-m", "snipinator.cli"]
CMD ["--help"]
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD python -m snipinator.cli --version || exit 1