-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
84 lines (67 loc) · 2.27 KB
/
Dockerfile
File metadata and controls
84 lines (67 loc) · 2.27 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
ARG LPP_VERSION=v4.0.1
FROM ghcr.io/ericsson/supl-3gpp-lpp-client:${LPP_VERSION} AS builder
FROM python:3-slim-bookworm
ARG LPP_VERSION
ARG LPP_CLIENT_CONTAINER_VERSION=0.0.0
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y libssl-dev tini supervisor && rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir tornado
RUN mkdir /lpp-client
COPY --from=builder /app/docker_build/example-* /lpp-client/
COPY ./*.py /lpp-client/
COPY ./views /lpp-client/views
RUN mkdir /lpp-client/log
# sdk files and build the SDK
COPY ./package_application.py /package_application.py
COPY ./package.ini /lpp-client/package.ini
COPY ./start.sh /lpp-client/start.sh
# Adjust package.ini to include the correct version
RUN version_minor=$(echo ${LPP_CLIENT_CONTAINER_VERSION} | cut -d'.' -f2) && \
sed -i "s/version_minor = 0/version_minor = ${version_minor}/" /lpp-client/package.ini
# Create .env file
COPY <<EOF /lpp-client/.env
LPP_VERSION=${LPP_VERSION}
LPP_CLIENT_CONTAINER_VERSION=${LPP_CLIENT_CONTAINER_VERSION}
WEBAPP=true
EOF
RUN python3 /package_application.py lpp-client
COPY <<EOF /etc/supervisord.conf
[supervisord]
nodaemon=true
user=root
[program:main]
directory=/lpp-client
command=python main.py
autostart=true
autorestart=true
environment=WEBAPP=%(ENV_WEBAPP)s,LPP_VERSION=%(ENV_LPP_VERSION)s,LPP_CLIENT_CONTAINER_VERSION=%(ENV_LPP_CLIENT_CONTAINER_VERSION)s
stdout_logfile=/dev/fd/1
stderr_logfile=/dev/fd/2
stdout_logfile_maxbytes=0
stderr_logfile_maxbytes=0
[program:webapp]
directory=/lpp-client
command=python webapp.py
autostart=true
autorestart=true
environment=WEBAPP=%(ENV_WEBAPP)s,LPP_VERSION=%(ENV_LPP_VERSION)s,LPP_CLIENT_CONTAINER_VERSION=%(ENV_LPP_CLIENT_CONTAINER_VERSION)s
stdout_logfile=/dev/fd/1
stderr_logfile=/dev/fd/2
stdout_logfile_maxbytes=0
stderr_logfile_maxbytes=0
[eventlistener:quit_on_failure]
directory=/lpp-client
events=PROCESS_STATE_FATAL
command=/bin/bash -c "python ./event_handler.py \$PPID"
environment=TRIGGER_PROCESS=main
stdout_logfile=/dev/fd/1
stderr_logfile=/dev/fd/2
stdout_logfile_maxbytes=0
stderr_logfile_maxbytes=0
EOF
ENV WEBAPP=false
ENV LPP_VERSION=${LPP_VERSION}
ENV LPP_CLIENT_CONTAINER_VERSION=${LPP_CLIENT_CONTAINER_VERSION}
EXPOSE 8080
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["supervisord", "-c", "/etc/supervisord.conf"]