-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
67 lines (56 loc) · 2.15 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#
# Dockerfile for pfdcm.
#
# Build with
#
# docker build -t <name> .
#
# For example if building a local version, you could do:
#
# docker build --build-arg UID=$UID -t local/pfdcm .
#
# In the case of a proxy (located at say 10.41.13.4:3128), do:
#
# export PROXY="http://10.41.13.4:3128"
# docker build --build-arg http_proxy=${PROXY} --build-arg UID=$UID -t local/pfdcm .
#
# To run an interactive shell inside this container, do:
#
# docker run -ti --entrypoint /bin/bash local/pfdcm
#
# To pass an env var HOST_IP to the container, do:
#
# docker run -ti -e HOST_IP=$(ip route | grep -v docker | awk '{if(NF==11) print $9}') --entrypoint /bin/bash local/pfdcm
#
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim
LABEL DEVELOPMENT=" \
docker run --rm -it \
-p 4005:4005 -p 10402:10402 -p 5555:5555 -p 10502:10502 -p 11113:11113 \
-v $PWD/pfdcm:/app:ro local/pfdcm /start-reload.sh \
"
ENV DEBIAN_FRONTEND=noninteractive
COPY requirements.txt /tmp/requirements.txt
RUN pip install --upgrade pip
RUN pip install -r /tmp/requirements.txt && rm -v /tmp/requirements.txt
RUN pip install https://github.com/msbrogli/rpudb/archive/master.zip
RUN pip install tzlocal
RUN pip install ipython
RUN pip install pydantic
COPY ./pfdcm /app
RUN apt update && \
apt-get install -y apt-transport-https && \
apt -y install xinetd && \
apt -y install dcmtk && \
apt -y install ssh iputils-ping && \
apt -y install vim telnet netcat-traditional procps binutils
COPY xinetd_default /etc/default/xinetd
# Create the 'localuser' group with specified GID
RUN groupadd -g 1102 localuser
# Create the 'localuser' user with specified UID, add to the group, and create home directory
RUN useradd -u 7748 -g localuser -m -s /bin/bash localuser
# Grant sudo privileges to the 'localuser' user
RUN apt-get update && apt-get install -y sudo
RUN echo '%localuser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# USER localuser
ENV PORT=4005
EXPOSE ${PORT} 10402 10502 5555 11113