Add Docker dev environment and initial code

This commit is contained in:
Lexi / Zoe 2022-03-25 20:03:33 +01:00
parent 484b0210bb
commit 0be947b3d1
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
10 changed files with 173 additions and 150 deletions

22
Dockerfile.dev Normal file
View file

@ -0,0 +1,22 @@
FROM python:3.10
# Install pipenv container-wide as root
RUN pip install pipenv
# Create unprivileged user with UID as specified by the build argument DEV_USER_UID, defaulting to 1000.
# (This should match the UID of your local user. If it doesn't, use an ".env" file to overwrite this variable.)
ARG DEV_USER_UID=1000
RUN echo Creating dev user with UID $DEV_USER_UID && \
useradd -m -u $DEV_USER_UID dev
USER dev
## Create virtual environment using pipenv
WORKDIR /app
COPY Pipfile Pipfile.lock ./
RUN pipenv install --dev --deploy
# Set entrypoint to always run commands inside virtual environment
ENTRYPOINT ["pipenv", "run"]
# Set default command
CMD ["bash"]