Files
Bram ff7b0459bc
Build and Push Docker Images / build-and-push (push) Failing after 11s
port syncer
2025-10-24 22:18:01 +02:00

34 lines
639 B
Docker

FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
RUN pip install --no-cache-dir \
requests \
watchdog
# Create app directory
WORKDIR /app
# Copy the Python script
COPY main.py .
# Make the script executable
RUN chmod +x main.py
# Create a non-root user
RUN useradd -m -u 1000 appuser && \
chown -R appuser:appuser /app
# Switch to non-root user
USER appuser
# Set default environment variables
ENV PORT_FORWARDED=/tmp/port_forwarded
ENV HTTP_S=http
# Run the application
CMD ["python", "main.py"]