From 7d4def14b1982c7213d27a341310d2febb29ce7b Mon Sep 17 00:00:00 2001 From: "Florian Paul Azim Hoberg (@gyptazy)" Date: Wed, 19 Mar 2025 14:48:44 +0100 Subject: [PATCH] feature: Add Dockerfile to create container image * Also switch from Debian image to Alpine image --- Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f7e68ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Use the latest Alpine image +FROM alpine:latest + +# Labels +LABEL maintainer="gyptazy@gyptazy.com" +LABEL org.label-schema.name="ProxLB" +LABEL org.label-schema.description="ProxLB - An advanced load balancer for Proxmox clusters." +LABEL org.label-schema.vendor="gyptazy" +LABEL org.label-schema.url="https://proxlb.de" +LABEL org.label-schema.vcs-url="https://github.com/gyptazy/ProxLB" + +# Install Python3 +RUN apk add --no-cache python3 py3-pip + +# Create a directory for the app +WORKDIR /app + +# Copy the python program from the current directory to /app +COPY proxlb /app/proxlb + +# Copy requirements to the container +COPY requirements.txt /app/requirements.txt + +# Install dependencies in the virtual environment +RUN pip install --break-system-packages -r /app/requirements.txt + +# Set the entry point to use the virtual environment's python +ENTRYPOINT ["/bin/python3", "/app/proxlb/main.py"]