Files
docker-ara/docker/Dockerfile
Aaron Guise 6d5cfc3110
Some checks failed
CI / build (push) Successful in 37s
CI / release (release) Failing after 3m9s
feat: Add Docker support with environment configuration and cron maintenance
2026-02-21 16:48:05 +13:00

65 lines
2.3 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
FROM almalinux:9.5-minimal
ARG DEV_DEPENDENCIES="gcc python3-devel postgresql-devel mariadb-devel"
# Install only the runtime packages we need, including cronie for cron support
# tini is used as PID 1 to reap zombie processes spawned by crond and forward
# signals correctly to gunicorn on `docker stop`.
# tzdata is required so named timezones (e.g. Pacific/Auckland) are available
# to crond when TZ is set at runtime.
RUN microdnf install -y epel-release \
&& microdnf install -y \
python3-pip \
libpq \
mariadb-connector-c \
cronie \
tini \
tzdata \
&& microdnf clean all
# Install build-time dependencies, build Python packages, then remove them
RUN microdnf install -y ${DEV_DEPENDENCIES} \
&& python3 -m pip install --no-cache-dir "ara[server,postgresql,mysql]" gunicorn \
&& microdnf remove -y ${DEV_DEPENDENCIES} \
&& microdnf clean all
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# ---------------------------------------------------------------------------
# ARA server configuration all values can be overridden at runtime via
# environment variables (see https://ara.readthedocs.io/en/latest/api-configuration.html)
# ---------------------------------------------------------------------------
# Core
ENV ARA_BASE_DIR=/opt/ara
# ENV ARA_SECRET_KEY=changeme # set a stable secret in production
# ENV ARA_ALLOWED_HOSTS="['*']" # restrict to your hostname(s)
# ENV ARA_TIME_ZONE=UTC # ARA display/storage timezone
# ENV TZ=UTC # system/crond timezone — set to match ARA_TIME_ZONE
# Database (defaults to sqlite inside ARA_BASE_DIR)
# ENV ARA_DATABASE_ENGINE=django.db.backends.postgresql
# ENV ARA_DATABASE_NAME=ara
# ENV ARA_DATABASE_USER=ara
# ENV ARA_DATABASE_PASSWORD=secret
# ENV ARA_DATABASE_HOST=db
# ENV ARA_DATABASE_PORT=5432
# Security / auth
# ENV ARA_READ_LOGIN_REQUIRED=false
# ENV ARA_WRITE_LOGIN_REQUIRED=false
# Server tuning
# ENV ARA_PORT=8000
# ENV ARA_GUNICORN_WORKERS=4
# ENV ARA_PAGE_SIZE=100
# ENV ARA_LOG_LEVEL=INFO
# Maintenance / pruning
# ENV ARA_PRUNE_DAYS=30 # delete playbooks older than N days
# ENV ARA_PRUNE_CRON="0 2 * * *" # cron schedule for pruning (default: daily 02:00)
EXPOSE ${ARA_PORT:-8000}
ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]