-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
53 lines (42 loc) · 1.71 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
FROM python:3.10
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
RUN curl -sSL https://install.python-poetry.org | python3 - && \
/root/.local/bin/poetry config virtualenvs.create false
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Copy reprounzip-docker
COPY reprozip /usr/src/app/reprozip
# Install dependencies
COPY pyproject.toml poetry.lock /usr/src/app/
RUN /root/.local/bin/poetry install --no-interaction --only main
# Install Docker
RUN curl -Lo /tmp/docker.tgz https://download.docker.com/linux/static/stable/x86_64/docker-20.10.7.tgz && \
tar -xf /tmp/docker.tgz -C /usr/local && \
mv /usr/local/docker/* /usr/local/bin/ && \
rmdir /usr/local/docker && \
rm /tmp/docker.tgz
# Download assets
COPY scripts scripts
RUN scripts/get_assets.sh
# Add tools
RUN mkdir /opt/rpz-tools-x86_64 && \
curl -Lo /opt/rpz-tools-x86_64/rpztar https://github.com/remram44/rpztar/releases/download/v0-whole-rpz/rpztar-x86_64 && \
curl -Lo /opt/rpz-tools-x86_64/rpzsudo https://github.com/remram44/static-sudo/releases/download/current/rpzsudo-x86_64 && \
curl -Lo /opt/rpz-tools-x86_64/busybox https://s3.amazonaws.com/reprozip-files/busybox-x86_64 && \
chmod +x /opt/rpz-tools-x86_64/*
# Install package
COPY reproserver /usr/src/app/reproserver
COPY README.md LICENSE.txt /usr/src/app/
RUN /root/.local/bin/poetry install --no-interaction --only main
ENV REPROZIP_USAGE_STATS=off
# Set up user
RUN mkdir /usr/src/app/home && \
useradd -d /usr/src/app/home -s /usr/sbin/nologin appuser && \
chown appuser /usr/src/app/home
USER appuser
ENV HOME=/usr/src/app/home
EXPOSE 8000
ENTRYPOINT ["/tini", "--"]
CMD ["reproserver"]