Skip to content

Commit f0f412e

Browse files
authored
Update Dockerfile
Resolve the issue of appuser
1 parent 7c16d97 commit f0f412e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Use a slim version of Python 3.10 as the base image
22
FROM python:3.10-slim
33

4-
# Environment variables to prevent Python from writing .pyc files
4+
# Set environment variables to prevent Python from writing .pyc files
55
# and to ensure output is logged directly
66
ENV PYTHONDONTWRITEBYTECODE=1
77
ENV PYTHONUNBUFFERED=1
@@ -13,10 +13,13 @@ WORKDIR /app
1313
RUN apt-get update && \
1414
apt-get install -y --no-install-recommends \
1515
git \
16-
build-essential && \
17-
apt-get clean && \
16+
build-essential \
17+
&& apt-get clean && \
1818
rm -rf /var/lib/apt/lists/*
1919

20+
# Create a non-root user and switch to that user
21+
RUN useradd -m appuser
22+
2023
# Copy requirements file and install Python dependencies
2124
COPY requirements.txt .
2225
RUN pip install --upgrade pip && \

0 commit comments

Comments
 (0)