diff options
author | Matthew Lemon <y@yulqen.org> | 2024-05-23 14:01:57 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-05-23 14:01:57 +0100 |
commit | 84cdaedf5cbde6a60e2840ab35fcccf8106bd0f2 (patch) | |
tree | 7d650e6e53c31f5f69cc20932cf8e24144c11a1f /Dockerfile | |
parent | 5f5a3de40a8d2fa9c6067c2b0fa567ff11419e80 (diff) |
Local Docker environment is now runnable with make
Diffstat (limited to '')
-rw-r--r-- | Dockerfile | 18 | ||||
-rw-r--r-- | Dockerfile_postgresql | 6 |
2 files changed, 10 insertions, 14 deletions
@@ -1,5 +1,5 @@ # Builder stage -FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218 AS builder +FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218 AS builder # Add application sources USER 0 @@ -26,23 +26,13 @@ WORKDIR /app # Copy from builder COPY --from=builder /app /app +RUN apt update && apt install -y --no-install-recommends libpq-dev build-essential + # Install packages RUN pip install -r requirements.txt -# Copy across db file and set permissions -COPY db.sqlite3 /app/db.sqlite3 -RUN chown 1001:0 /app && \ - chmod 664 /app/db.sqlite3 - -# Set user -USER 1001 - -ENV DJANGO_SETTINGS_MODULE=conf.settings.base - -# Migrate database -RUN python manage.py migrate +ENV DJANGO_SETTINGS_MODULE=conf.settings.local -# Expose port EXPOSE 8000 # Start app diff --git a/Dockerfile_postgresql b/Dockerfile_postgresql new file mode 100644 index 0000000..9111660 --- /dev/null +++ b/Dockerfile_postgresql @@ -0,0 +1,6 @@ +FROM registry.redhat.io/rhel9/postgresql-16 + +ENV POSTGRESQL_USER=postgres \ + POSTGRESQL_PASSWORD=postgres + +CMD ["/usr/bin/run-postgresql"] |