Add Docker dev environment and initial code
This commit is contained in:
parent
484b0210bb
commit
0be947b3d1
10 changed files with 173 additions and 150 deletions
22
Dockerfile.dev
Normal file
22
Dockerfile.dev
Normal 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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue