switching to alpine and using git.allucanget.biz docker registry
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
# Use official Python image
|
||||
FROM python:3.11-slim
|
||||
FROM python:3.12-alpine
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies if needed (none for this app)
|
||||
# RUN apt-get update && apt-get install -y gcc && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy requirements and install Python dependencies
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
@@ -15,8 +12,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY . .
|
||||
|
||||
# Create a non-root user
|
||||
RUN useradd --create-home --shell /bin/bash app
|
||||
USER app
|
||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
USER appuser
|
||||
|
||||
# Command to run the application
|
||||
CMD ["python", "main.py"]
|
||||
|
||||
Reference in New Issue
Block a user