This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Dockerfile
79 lines (59 loc) · 2.2 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM ubuntu:20.04
LABEL maintainer=FreeTAKTeam
ARG FTS_VERSION=1.9
ARG FTS_UI_VERSION=1.8.1
# UTC for buildtimes
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime
#APT
RUN apt-get update && \
apt-get install -y libssl-dev libffi-dev curl python3 python3-pip \
libxml2-dev libxslt-dev python3-lxml python3-dev \
python3-setuptools build-essential iproute2 &&\
rm -rf /var/lib/apt/lists/*
#PIP3
RUN pip3 install supervisor &&\
pip3 install requests &&\
pip3 install flask_login &&\
pip3 install FreeTAKServer==${FTS_VERSION} && \
pip3 install FreeTAKServer-UI==${FTS_UI_VERSION} && \
pip3 install defusedxml &&\
pip3 install pyopenssl &&\
pip3 install pytak
# Create FTS user
RUN addgroup --gid 1000 fts && \
adduser --disabled-password --uid 1000 --ingroup fts --home /home/fts fts
# Supervisord conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Logrotation
COPY ftsrotate /etc/logrotate.d/ftsrotate
COPY fatalexit /usr/local/bin/fatalexit
RUN chmod +x /usr/local/bin/fatalexit
# Start script
# This handles env variables and starts the service
COPY start-fts.sh /start-fts.sh
RUN chmod +x /start-fts.sh
# FTS ports
EXPOSE 8080
EXPOSE 8087
EXPOSE 8089
EXPOSE 8443
EXPOSE 19023
# FTS UI port
EXPOSE 5000
# UI Config changes
RUN sed -i 's/root/data/g' /usr/local/lib/python3.8/dist-packages/FreeTAKServer-UI/config.py &&\
sed -i 's+certpath = .*+certpath = "/data/certs/"+g' /usr/local/lib/python3.8/dist-packages/FreeTAKServer-UI/config.py &&\
#Adjust database path
sed -i 's/data\/FTSDataBase.db/data\/database\/FTSDataBase.db/g' /usr/local/lib/python3.8/dist-packages/FreeTAKServer-UI/config.py &&\
chmod 777 /usr/local/lib/python3.8/dist-packages/FreeTAKServer-UI/config.py &&\
chmod 777 /usr/local/lib/python3.8/dist-packages/FreeTAKServer-UI/
# FTS MainConfig changes
RUN sed -i 's+first_start = .*+first_start = False+g' /usr/local/lib/python3.8/dist-packages/FreeTAKServer/controllers/configuration/MainConfig.py &&\
sed -i 's/\r$//' /start-fts.sh
VOLUME ["/data"]
COPY FTSConfig.yaml /opt/FTSConfig.yaml
ENV APPIP=0.0.0.0
# Use non root user
# TODO: Folder perms
#USER fts
ENTRYPOINT ["/bin/bash", "/start-fts.sh"]