Files
nvhi-atsila-microservice/Dockerfile

21 lines
472 B
Docker
Raw Normal View History

2025-07-12 08:51:48 +00:00
FROM python:3.10-slim
2025-08-03 00:10:47 +00:00
# Create a non-root user and group
RUN adduser --disabled-password --gecos '' myuser
# Set working directory
2025-07-12 08:51:48 +00:00
WORKDIR /app
2025-08-03 00:10:47 +00:00
# Copy requirements and install dependencies as root (needed for system-wide install)
2025-07-12 08:51:48 +00:00
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
2025-08-03 00:10:47 +00:00
# Copy app code
2025-07-12 08:51:48 +00:00
COPY app.py .
2025-08-03 00:10:47 +00:00
# Change to non-root user
USER myuser
2025-07-12 08:51:48 +00:00
2025-08-03 00:10:47 +00:00
# Expose port and start app
EXPOSE 8080
2025-07-12 08:51:48 +00:00
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]