Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
# Possible values: critical, error, warning, info, debug, trace.
# Default is warning
LOG_LEVEL=
# This variable can be used to disable internal tugtainer-agent,
# for instance, if you cannot use docker.sock on this host, but want to monitor other remote hosts
# Default is true (agent enabled)
AGENT_ENABLED=
# Secret for backend-agent requests signature.
# Better to set it if agent is on the other network.
# Default is empty, because agent is used internally in the main image.
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile.app
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ ENV PATH="/app/.venv/bin:$PATH"
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Entrypoint script
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

# Environment
COPY .env* /app/
RUN echo "$VERSION" > /app/version
Expand All @@ -54,4 +58,4 @@ EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8000/api/public/health || exit 1

ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
ENTRYPOINT ["/app/entrypoint.sh"]
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
AGENT_ENABLED="${AGENT_ENABLED:-true}"
AGENT_ENABLED=$(echo "$AGENT_ENABLED" | tr '[:upper:]' '[:lower:]')
export AGENT_ENABLED
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
1 change: 1 addition & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ priority=10
[program:agent]
command=python -m agent.start
directory=/app
autostart=%(ENV_AGENT_ENABLED)s
autorestart=true
priority=20
stdout_logfile=/dev/stdout
Expand Down