Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Data folder fix (#15)
Browse files Browse the repository at this point in the history
* check if volum earlier do not hurt supervisord folder

check if volum earlier do not hurt supervisord folder

* Update Dockerfile

?!

* Update Dockerfile

* Update Dockerfile

* UTC masterrace

* Sync towards master

* Update Dockerfile

* oversight

* Update Dockerfile

* Update supervisord.conf

If this works i hate supervisord

* Update supervisord.conf

* Update Dockerfile

* Update supervisord.conf

?

* Update Dockerfile

* Update Dockerfile

* Update supervisord.conf

* Update supervisord.conf

* Update Dockerfile

* Update start-fts.sh

* Update Dockerfile

* Update Dockerfile

* Update start-fts.sh

* Update start-fts.sh

* Update start-fts.sh
  • Loading branch information
skadakar authored Apr 24, 2021
1 parent d7ef0a1 commit 22e335f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
22 changes: 8 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ MAINTAINER FreeTAKTeam

ARG FTS_VERSION=1.7.5

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=America/New_York
# UTC for buildtimes
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime

RUN apt-get update && \
apt-get -y upgrade && \
Expand All @@ -18,24 +18,18 @@ RUN python3 --version && \
pip3 install FreeTAKServer[ui]==${FTS_VERSION} && \
pip3 install defusedxml

# non root user
# Create FTS user
RUN addgroup --gid 1000 fts && \
adduser --uid 1000 --ingroup fts --home /home/fts fts && \
mkdir -m 775 /data && \
mkdir -p /data/logs && \
chmod 775 /data/logs && \
chown fts:fts -R /data /home/fts

# Container friendly supervisor
RUN mkdir -p /data/logs/supervisor/ && \
chown -R fts:fts /data/logs/supervisor
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

# Logrotation
COPY ftsrotate /etc/logrotate.d/ftsrotate

# Start script
# This handles env variables and starts the service
Expand Down
7 changes: 7 additions & 0 deletions start-fts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ echo "###########################"
echo "Preparing"
echo "###########################"

#Touch
#Create log folders
echo "Create logs folder"
mkdir -p /data/logs/supervisor
echo "Set permissions on data folder"
chmod -R 777 /data

#Setting variables:

#DataPackageServiceDefaultIP
Expand Down
29 changes: 14 additions & 15 deletions supervisord.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[supervisord]
nodaemon=true
logfile=/data/logs/supervisor/supervisord.log
stderror_logfile=/data/logs/supervisor/stderr.log
stdout_logfile=/data/logs/supervisor/stdout.log
stderr_logfile=/data/logs/supervisor/%(program_name)s_stderr.log
stderr_logfile_maxbytes=10MB
stdout_logfile=/data/logs/supervisor/%(program_name)s_stdout.log
stdout_logfile_maxbytes=10MB
redirect_stderr=true
file=/home/fts/supervisor.sock
user=root
Expand All @@ -14,12 +15,11 @@ PIDFILE=/home/fts/suporvisord.pid
command=python3 -m FreeTAKServer.controllers.services.FTS
autostart=true
autorestart=true
stderr_logfile=/data/logs/supervisor/FTS_stderr.log
stdout_logfile=/data/logs/supervisor/FTS_stdout.log
stdout_logfile_maxbytes=0
stderr_logfile_maxbytes=0
stdout_logfile_backups=0
stderr_logfile_backups=0
stderr_logfile=/data/logs/supervisor/%(program_name)s_stderr.log
stderr_logfile_maxbytes=10MB
stdout_logfile=/data/logs/supervisor/%(program_name)s_stdout.log
stdout_logfile_maxbytes=10MB
redirect_stderr=true
user=fts
environment=HOME="/home/fts",USER="fts"
PIDFILE=/home/fts/fts.pid
Expand All @@ -29,12 +29,11 @@ command=bash -c "FLASK_APP=/usr/local/lib/python3.8/dist-packages/FreeTAKServer-
autostart=true
autorestart=true
startretries=20
stderr_logfile=/data/logs/supervisor/UI_stderr.log
stdout_logfile=/data/logs/supervisor/UI_stdout.log
stdout_logfile_maxbytes=0
stderr_logfile_maxbytes=0
stdout_logfile_backups=0
stderr_logfile_backups=0
stderr_logfile=/data/logs/supervisor/%(program_name)s_stderr.log
stderr_logfile_maxbytes=10MB
stdout_logfile=/data/logs/supervisor/%(program_name)s_stdout.log
stdout_logfile_maxbytes=10MB
redirect_stderr=true
environment=HOME="/home/fts",USER="fts"
PIDFILE=/home/fts/fts-ui.pid

Expand Down

0 comments on commit 22e335f

Please sign in to comment.