From d00d007306b39e1034b3bc35f19723c1cf855ffd Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Mon, 26 Aug 2024 20:37:55 +0200 Subject: [PATCH] Dockerfile(s): the afternoon's progress --- Dockerfile | 23 +++++++++++++++++++++++ Dockerfile.db | 7 +++++++ 2 files changed, 30 insertions(+) create mode 100644 Dockerfile create mode 100644 Dockerfile.db diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dc383b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# Purpose: Dockerfile for the Bugsink project +# Ubuntu 24.04 rather than the Python image: I want to stick as closely to the "recommended" (single server) deployment +# as possible +FROM ubuntu:24.04 +WORKDIR /app + +COPY requirements.txt . + +RUN apt update +RUN apt install python3 python3-pip python3-venv -y + +# mysqlclient dependencies +RUN apt install default-libmysqlclient-dev pkg-config -y + +# Venv inside Docker? I'd say yes because [1] PEP 668 and [2] harmonization with "recommended" (single server) deployment +RUN python3 -m venv venv +RUN venv/bin/python3 -m pip install --no-cache-dir -r requirements.txt + +COPY . . + +EXPOSE 9000 + +CMD ["venv/bin/gunicorn", "--bind=0.0.0.0:9000", "--access-logfile", "-", "bugsink.wsgi"] diff --git a/Dockerfile.db b/Dockerfile.db new file mode 100644 index 0000000..96d4a1c --- /dev/null +++ b/Dockerfile.db @@ -0,0 +1,7 @@ +FROM mysql + +ENV MYSQL_DATABASE=bugsink +ENV MYSQL_USER=bugsink + +# Expose the default port +EXPOSE 3306