FROM almalinux:9 ARG DEV_DEPENDENCIES="gcc python3-devel postgresql-devel mariadb-devel" RUN dnf install -y epel-release \ && crb enable \ && dnf update -y \ && dnf install -y which \ python3-pip \ postgresql \ libpq \ mariadb-connector-c # Install development dependencies required for installing packages from PyPI RUN dnf install -y ${DEV_DEPENDENCIES} # Install ara from PyPI with API server extras for dependencies (django & django-rest-framework) # including database backend libraries and gunicorn RUN python3 -m pip install "ara[server,mysql]" gunicorn # Remove development dependencies and clean up RUN dnf remove -y ${DEV_DEPENDENCIES} \ && dnf autoremove -y \ && dnf clean all \ && 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 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"] EXPOSE 8000