-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.dockerfile
More file actions
54 lines (43 loc) · 1.69 KB
/
Copy pathpython.dockerfile
File metadata and controls
54 lines (43 loc) · 1.69 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
FROM python:3.14.4-slim-trixie
ARG USER
ARG GROUP
ARG LIB_NAME
ARG PYTHON_REQUIRED_LIBS
ENV PATH="/home/${USER}/.local/bin:${PATH}"
ENV USER="$USER"
ENV LIB_NAME="$LIB_NAME"
RUN apt update && \
apt install -y \
openssh-client \
curl \
sudo \
less \
vim \
nano \
iperf3 \
supervisor \
gettext && \
apt-get clean && \
rm --recursive --force /tmp/* /var/tmp/*
RUN groupadd -g 510 ${GROUP} && \
useradd -rm -d /home/${USER} -s /bin/bash -g ${GROUP} -u 1010 -G sudo ${USER} && \
echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/${USER}
USER ${USER}
WORKDIR /home/${USER}
RUN python3 -m pip install ${PYTHON_REQUIRED_LIBS}
RUN mkdir /home/${USER}/.ssh
COPY --chown=${USER}:${GROUP} src/ /home/${USER}/python
COPY --chown=${USER}:${GROUP} pyproject.toml /home/${USER}/python
RUN mkdir --parents /home/${USER}/${LIB_NAME}/conf && \
chown ${USER}:${GROUP} --recursive /home/${USER}/${LIB_NAME}/
COPY --chown=${USER}:${GROUP} conf/supervisord.conf /home/${USER}/${LIB_NAME}/conf/supervisord.conf
RUN msgfmt --output-file \
/home/${USER}/python/imgtests/web/locale/ru/LC_MESSAGES/django.mo \
/home/${USER}/python/imgtests/web/locale/ru/LC_MESSAGES/django.po && \
msgfmt --output-file \
/home/${USER}/python/imgtests/web/locale/ru/LC_MESSAGES/djangojs.mo \
/home/${USER}/python/imgtests/web/locale/ru/LC_MESSAGES/djangojs.po
RUN cd /home/${USER}/python && python3 -m pip install . && rm -rf /home/${USER}/python
COPY --chown=${USER}:${GROUP} scripts/entrypoint-analyzer.sh /home/${USER}/${LIB_NAME}/entrypoint-analyzer.sh
RUN chmod +x /home/${USER}/${LIB_NAME}/entrypoint-analyzer.sh
ENTRYPOINT ["/home/user/imgtests/entrypoint-analyzer.sh"]