-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-3.9
63 lines (56 loc) · 1.87 KB
/
Dockerfile-3.9
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
FROM ubuntu:20.04
LABEL maintainer="DL-devops-behance <[email protected]>"
# Use in multi-phase builds, when an init process requests for the container to gracefully exit, so that it may be committed
# Used with alternative CMD (worker.sh), leverages supervisor to maintain long-running processes
ENV DEBIAN_FRONTEND=noninteractive \
SIGNAL_BUILD_STOP=99 \
# CONTAINER_ROLE=web \
CONTAINER_PORT=8080 \
NOT_ROOT_USER=www-data \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_KILL_FINISH_MAXTIME=5000 \
S6_KILL_GRACETIME=3000 \
LANG=C.UTF-8 \
APP_ROOT=/app
RUN apt-get clean && apt-get update && apt-get install -y locales && \
locale-gen en_US.UTF-8 && export LANG=en_US.UTF-8 && \
# Install pre-reqs \
apt-get update && \
apt-get upgrade -yqq && \
apt-get -yqq install \
software-properties-common \
&& \
# Install python3.9 from a PPA
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get upgrade -yqq && \
apt-get -yqq install \
python3.9\
python3-pip \
python3.9-dev \
&& \
pip3 install --upgrade pip && \
pip3 install --upgrade setuptools && \
apt-get remove --purge -yq \
software-properties-common \
manpages \
manpages-dev \
man-db \
patch \
make \
unattended-upgrades \
&& \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/lib/{cache,log}/ && \
rm -rf /tmp/* /var/tmp/*
ENV LC_ALL=en_US.UTF-8
COPY ./container/root /
# Add S6 overlay build, to avoid having to build from source
RUN tar xzf /tmp/s6-overlay-amd64.tar.gz -C / && \
rm /tmp/s6-overlay-amd64.tar.gz
EXPOSE ${CONTAINER_PORT}
# NOTE: intentionally NOT using s6 init as the entrypoint
# This would prevent container debugging if any of those service crash
CMD ["/bin/bash", "/run.sh"]