From 941aedc20829720e105be2b6b8ab45ef112fd616 Mon Sep 17 00:00:00 2001 From: Aaron Guise Date: Sat, 15 Feb 2025 07:03:23 +1300 Subject: [PATCH] feat: Initial Commit --- Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..508a1b6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM almalinux:9.5-minimal +ARG DEV_DEPENDENCIES="gcc python3-devel postgresql-devel mariadb-devel" + +RUN dnf update -y \ + && dnf install -y which \ + python3-pip \ + python3-wheel \ + 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,postgresql,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 ["bash", "-c", "/usr/local/bin/ara-manage migrate && python3 -m gunicorn --workers=4 --access-logfile - --bind 0.0.0.0:8000 ara.server.wsgi" ] +EXPOSE 8000 \ No newline at end of file