-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
31 lines (20 loc) · 904 Bytes
/
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
FROM dockershelf/python:3.10
LABEL maintainer "Luis Alejandro Martínez Faneyth <[email protected]>"
ARG UID=1000
ARG GID=1000
RUN apt-get update && \
apt-get install sudo python3.10-venv bundler
ADD requirements.txt /root/
RUN pip3 install -r /root/requirements.txt
RUN rm -rf /root/requirements.txt
RUN EXISTUSER=$(getent passwd | awk -F':' '$3 == '$UID' {print $1}') && \
[ -n "${EXISTUSER}" ] && deluser ${EXISTUSER} || true
RUN EXISTGROUP=$(getent group | awk -F':' '$3 == '$GID' {print $1}') && \
[ -n "${EXISTGROUP}" ] && delgroup ${EXISTGROUP} || true
RUN groupadd -g "${GID}" dockershelf || true
RUN useradd -u "${UID}" -g "${GID}" -ms /bin/bash dockershelf
RUN echo "dockershelf ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/dockershelf
USER dockershelf
RUN mkdir -p /home/dockershelf/app
WORKDIR /home/dockershelf/app
CMD tail -f /dev/null