This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile.external
64 lines (55 loc) · 2.11 KB
/
Dockerfile.external
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
64
# This is an example Dockerfile to run your service in PaaSTA!
# It satisfies the PaaSTA contract.
ARG DOCKER_REGISTRY
ARG IMAGE_NAME
FROM ${DOCKER_REGISTRY}/${IMAGE_NAME}
# python and uwsgi deps
RUN apt-get update && apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
awscli \
g++ \
git \
libatlas-base-dev \
libpython3.8 \
libxml2 \
libyaml-0-2 \
lsb-release \
make \
openssh-client \
software-properties-common \
gpg \
gpg-agent \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-cache policy python3.8 \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.8 \
libtiff-dev \
libfreetype-dev \
libfreetype6 \
libfreetype6-dev \
python3.8-dev \
python3.8-distutils \
python3-apt \
python3-pip \
python3-setuptools \
virtualenv \
&& apt-get clean
RUN /usr/bin/pip3 install setuptools supervisor tox==3.24.4
COPY tox.ini requirements.txt requirements-bootstrap.txt /code/
RUN mkdir /home/nobody \
&& chown nobody /home/nobody
ENV HOME /home/nobody
# Code is COPY'ed here after the pip install above, so that code changes do not
# break the preceding cache layer.
COPY . /code
RUN chown nobody /code
RUN cd code && tox -e virtualenv_run && virtualenv_run/bin/pip3 install -eexamples/clusterman_metrics
RUN ln -s /code/clusterman/supervisord/fetch_clusterman_signal /usr/bin/fetch_clusterman_signal
RUN ln -s /code/clusterman/supervisord/run_clusterman_signal /usr/bin/run_clusterman_signal
RUN install -d --owner=nobody /code/logs
# Create /nail/run to store the batch PID file
RUN mkdir -p /nail/run && chown -R nobody /nail/run
# For sake of security, don't run your service as a privileged user
USER nobody
WORKDIR /code
ENV BASEPATH=/code PATH=/code/virtualenv_run/bin:$PATH