-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
44 lines (32 loc) · 1.07 KB
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.12-slim
ENV ENVIRONMENT=docker
ENV SSH_USERNAME=app
ENV PORT=8000
RUN groupadd --gid 10001 app \
&& useradd -m -g app --uid 10001 -d /app -s /usr/sbin/nologin app
RUN apt-get update && \
apt-get install --yes git mercurial curl tini && \
apt-get -q --yes autoremove && \
apt-get clean && \
rm -rf /root/.cache && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# git-cinnabar
COPY install_git-cinnabar.sh .
RUN ./install_git-cinnabar.sh \
&& mv git-cinnabar git-remote-hg /usr/bin/
COPY --chown=app:app requirements.txt .
RUN pip install -r requirements.txt
RUN mkdir -p /clones \
&& chown app:app /clones
# copy app and install
COPY docker/hgrc /etc/mercurial/hgrc
COPY docker/entrypoint.sh /entrypoint.sh
COPY --chown=app:app . /app
# Make the install editable so we can mount the local source into a container based on this image.
RUN pip install -e /app
USER app
HEALTHCHECK CMD curl -sfk http://localhost:$PORT -o/dev/null
# run service
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
CMD ["--config", "config-{{ENVIRONMENT}}.toml"]