-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
47 lines (30 loc) · 1.1 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
FROM python:3.8-slim as build_base
RUN apt-get update \
&& apt-get upgrade --yes
ENV DEBIAN_FRONTEND noninteractive
RUN apt install --yes \
apt-utils lsb-release ncompress \
xz-utils net-tools apt-utils \
autoconf automake build-essential
ENV USERNAME shua
RUN /usr/sbin/groupadd -g 10010 $USERNAME \
&& /usr/sbin/useradd -u 10010 -g 10010 --create-home --home /home/$USERNAME $USERNAME \
&& chown -R $USERNAME.$USERNAME /home/$USERNAME \
&& chsh -s /bin/bash $USERNAME
WORKDIR /home/$USERNAME
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix /home/$USERNAME/.local -r requirements.txt
FROM python:3.8-slim
ENV USERNAME shua
RUN /usr/sbin/groupadd -g 10010 $USERNAME \
&& /usr/sbin/useradd -u 10010 -g 10010 --create-home --home /home/$USERNAME $USERNAME \
&& chown -R $USERNAME.$USERNAME /home/$USERNAME \
&& chsh -s /bin/bash $USERNAME
WORKDIR /home/$USERNAME
USER $USERNAME
COPY --from=build_base /home/$USERNAME/.local /home/$USERNAME/.local
COPY nmt ./nmt/
COPY run.sh .
ENV PATH=/home/$USERNAME/.local/bin:$PATH
EXPOSE 31137
ENTRYPOINT ["./run.sh"]