2025-12-04 15:10:14 +13:00
|
|
|
FROM almalinux:9
|
2025-02-15 07:03:23 +13:00
|
|
|
ARG DEV_DEPENDENCIES="gcc python3-devel postgresql-devel mariadb-devel"
|
|
|
|
|
|
2025-12-04 15:10:14 +13:00
|
|
|
RUN dnf install -y epel-release \
|
2025-02-15 07:31:05 +13:00
|
|
|
&& crb enable \
|
2025-02-15 07:24:54 +13:00
|
|
|
&& dnf update -y \
|
2025-02-15 07:03:23 +13:00
|
|
|
&& dnf install -y which \
|
|
|
|
|
python3-pip \
|
|
|
|
|
postgresql \
|
|
|
|
|
libpq \
|
|
|
|
|
mariadb-connector-c
|
|
|
|
|
|
|
|
|
|
# Install development dependencies required for installing packages from PyPI
|
2025-12-04 15:10:14 +13:00
|
|
|
RUN dnf install -y ${DEV_DEPENDENCIES}
|
2025-02-15 07:03:23 +13:00
|
|
|
|
|
|
|
|
# Install ara from PyPI with API server extras for dependencies (django & django-rest-framework)
|
|
|
|
|
# including database backend libraries and gunicorn
|
2025-12-04 14:09:13 +13:00
|
|
|
RUN python3 -m pip install "ara[server,mysql]" gunicorn
|
2025-02-15 07:03:23 +13:00
|
|
|
|
|
|
|
|
# Remove development dependencies and clean up
|
2025-12-04 15:10:14 +13:00
|
|
|
RUN dnf remove -y ${DEV_DEPENDENCIES} \
|
|
|
|
|
&& dnf autoremove -y \
|
|
|
|
|
&& dnf clean all \
|
2025-02-15 07:03:23 +13:00
|
|
|
&& python3 -m pip cache purge
|
|
|
|
|
|
|
|
|
|
# Set up the container to execute SQL migrations and run the API server with gunicorn
|
|
|
|
|
ENV ARA_BASE_DIR=/opt/ara
|
2025-12-04 15:07:35 +13:00
|
|
|
CMD ["/bin/bash", "-c", "/usr/local/bin/ara-manage migrate && python3 -m gunicorn --workers=4 --access-logfile - --bind [::]:8000 --access-logformat '%%({x-forwarded-for}i)s %%l %%u %%t \"%%r\" %%s %%b \"%%f\" \"%%a\"' ara.server.wsgi"]
|
2025-02-15 07:03:23 +13:00
|
|
|
EXPOSE 8000
|