-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (51 loc) · 1.97 KB
/
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
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
##########################
## Build env
##########################
FROM python:3.10-buster AS BUILD
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
#RUN apt-get upgrade -y
RUN apt-get install -y --no-install-recommends \
ca-certificates pkg-config make \
libssl-dev libffi-dev libpq-dev
# python packages
RUN pip install --upgrade pip
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
##########################
## Final image
##########################
FROM python:3.10-buster
LABEL maintainer "CRG System Developers"
LABEL org.label-schema.schema-version="2.0"
LABEL org.label-schema.vcs-url="https://github.com/EGA-archive/beacon-2.x/"
# Too much ?
COPY --from=BUILD /usr/local/bin /usr/local/bin
COPY --from=BUILD /usr/local/lib /usr/local/lib
RUN apt-get update && \
# apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
nginx \
&& \
rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list && \
apt-get purge -y --auto-remove
COPY deploy/nginx.conf /beacon/nginx.conf
COPY deploy/supervisord.conf /beacon/supervisord.conf
COPY deploy/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY beacon /beacon/beacon
RUN groupadd beacon && \
useradd -M -g beacon beacon && \
# mkdir /beacon && \
mkdir /var/run/beacon && \
chown -R beacon:beacon /beacon && \
# chmod 400 /beacon/beacon/conf.py && \
chown -R beacon:beacon /var/log/nginx && \
chown -R beacon:beacon /var/lib/nginx && \
chown -R beacon:beacon /etc/nginx && \
chown -R beacon:beacon /var/run/beacon && \
mkdir -p /var/log/supervisord && \
chown -R beacon:beacon /var/log/supervisord && \
chmod +x /usr/local/bin/entrypoint.sh
WORKDIR /beacon
USER beacon
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]