Skip to content

Instantly share code, notes, and snippets.

@Jaxmetalmax
Created March 11, 2023 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jaxmetalmax/3a8dca1374f5fe6bcc3a287d6f9748c8 to your computer and use it in GitHub Desktop.
Save Jaxmetalmax/3a8dca1374f5fe6bcc3a287d6f9748c8 to your computer and use it in GitHub Desktop.
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.11.2-buster
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
# Install pip requirements
COPY requirements.txt .
RUN python -m pip install -r requirements.txt
WORKDIR /app
COPY . /app
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
RUN groupadd -g 1000 appuser \
&& useradd --no-log-init --shell /bin/bash -u 1000 -g 1000 -o -c "" -m appuser \
&& cp -r /etc/skel/. /home/appuser \
&& chown -R 1000:1000 /home/appuser
USER appuser
# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
CMD ["python", "ghstdurl.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment