mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
Update Dockerfile
This commit is contained in:
28
Dockerfile
28
Dockerfile
@@ -1,16 +1,28 @@
|
|||||||
# For more information, please refer to https://aka.ms/vscode-docker-python
|
|
||||||
FROM python:3.11-bookworm
|
FROM python:3.11-bookworm
|
||||||
# Turns off buffering for easier container logging
|
|
||||||
ENV PYTHONUNBUFFERED=1
|
# Keeps Python from generating .pyc files in the container
|
||||||
# Turns off pyc files
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
|
|
||||||
# Install pip requirements
|
# Turns off buffering for easier container logging
|
||||||
WORKDIR /Botator
|
ENV PYTHONUNBUFFERED=1
|
||||||
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /Botator
|
|
||||||
|
|
||||||
|
# we move to the app folder and run the pip install command
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# we copy just the requirements.txt first to leverage Docker cache
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
# Install pip requirements
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
|
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
|
||||||
|
RUN adduser -u 5574 --disabled-password --gecos "" appuser && chown -R appuser /app
|
||||||
USER appuser
|
USER appuser
|
||||||
|
|
||||||
|
# We copy the rest of the codebase into the image
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
# We run the application
|
||||||
CMD ["python", "main.py"]
|
CMD ["python", "main.py"]
|
||||||
Reference in New Issue
Block a user