-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) · 973 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (23 loc) · 973 Bytes
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
FROM dockershelf/python:3.12
LABEL maintainer="Luis Alejandro Martínez Faneyth <luis@luisalejandro.org>"
ARG UID=1000
ARG GID=1000
RUN apt-get update && \
apt-get install -y --no-install-recommends sudo git make jq libatomic1 && \
rm -rf /var/lib/apt/lists/*
ADD requirements-dev.txt /root/
RUN pip3 install -r /root/requirements-dev.txt && \
rm -rf /root/requirements-dev.txt
RUN EXISTUSER=$(getent passwd | awk -F':' '$3 == '$UID' {print $1}') && \
[ -n "${EXISTUSER}" ] && userdel ${EXISTUSER} || true
RUN EXISTGROUP=$(getent group | awk -F':' '$3 == '$GID' {print $1}') && \
[ -n "${EXISTGROUP}" ] && groupdel ${EXISTGROUP} || true
RUN groupadd -g "${GID}" agoras || true
RUN useradd -u "${UID}" -g "${GID}" -ms /bin/bash agoras
RUN echo "agoras ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/agoras
USER agoras
RUN mkdir -p \
/home/agoras/app \
/home/agoras/.cache/pip
WORKDIR /home/agoras/app
CMD ["tail", "-f", "/dev/null"]