-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
FROM python:3.11-slim-bullseye | ||
FROM python:3.11-alpine | ||
|
||
# Update the package list and install required packages | ||
RUN apt-get update && \ | ||
apt-get install -y git && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
WORKDIR /app | ||
|
||
# Copy the application source code to the container and set the working directory | ||
# Copy the application source code to the container | ||
COPY ./requirements.txt /app/requirements.txt | ||
|
||
# copy src | ||
COPY ./src /app/src | ||
|
||
WORKDIR /app | ||
|
||
# Install Python dependencies | ||
RUN pip3 install --no-cache-dir --upgrade pip && \ | ||
pip3 install --no-cache-dir -r requirements.txt | ||
# Update the package list, install required packages, and install Python dependencies | ||
RUN apk update && \ | ||
apk add --no-cache git && \ | ||
pip install --no-cache-dir --upgrade pip && \ | ||
pip install --no-cache-dir -r requirements.txt && \ | ||
rm -rf /var/cache/apk/* | ||
|
||
# Set the user to non-root | ||
USER 1000 | ||
USER 1000 |