-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (59 loc) · 2.25 KB
/
Copy pathDockerfile
File metadata and controls
73 lines (59 loc) · 2.25 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# syntax=docker/dockerfile:1
# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Dockerfile reference guide at
# https://docs.docker.com/engine/reference/builder/
ARG PYTHON_VERSION=3.9.18
FROM python:${PYTHON_VERSION}-slim-bullseye as base
# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1
# Keeps Python from buffering stdout and stderr to avoid situations where
# the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1 \
PROJECT_DIR=/app
WORKDIR $PROJECT_DIR
# Create a non-privileged user that the app will run under.
# See https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser
# Install OpenJDK-11 and Python
RUN apt-get update && \
apt-get install -qy \
mono-complete \
openjdk-11-jdk \
build-essential \
python-dev && \
rm -rf /var/lib/apt/lists/* && \
apt-get -qy autoremove && \
apt-get clean
# Setup JAVA_HOME -- useful for docker commandline
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
# Copy the source code into the container.
COPY setup.py \
README.md \
requirements.txt $PROJECT_DIR/
COPY --chown=appuser deTEL $PROJECT_DIR/deTEL
COPY utility $PROJECT_DIR/utility
# Download dependencies as a separate step to take advantage of Docker's caching.
# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
# Leverage a bind mount to requirements.txt to avoid having to copy them into
# into this layer.
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir --upgrade setuptools && \
pip install --no-cache-dir --upgrade pip-tools && \
pip install https://extras.wxpython.org/wxPython4/extras/linux/gtk3/debian-11/wxPython-4.2.1-cp39-cp39-linux_x86_64.whl && \
pip install .
COPY --chown=appuser binaries/fragpipe_v21_1 /fragpipe
ENV PATH="$PATH:/fragpipe/bin"
RUN mkdir -m 777 $PROJECT_DIR/inputs
# Switch to the non-privileged user to run the application.
USER appuser
# Run the application.
ENTRYPOINT ["python", "-m", "deTEL", "rTEL"]
CMD []