-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(devcontainer): build on the appcontainer
- Loading branch information
1 parent
d6ad986
commit 15e2781
Showing
4 changed files
with
9 additions
and
38 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,42 +1,8 @@ | ||
ARG PYTHON_VERSION=3.12 | ||
FROM caltrans/pems:app | ||
|
||
FROM python:${PYTHON_VERSION} | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 \ | ||
PYTHONUNBUFFERED=1 \ | ||
USER=caltrans | ||
|
||
# create non-root $USER and home directory | ||
RUN useradd --create-home --shell /bin/bash $USER && \ | ||
chown -R $USER /home/$USER | ||
|
||
# switch to $USER | ||
USER $USER | ||
|
||
# enter src directory | ||
WORKDIR /home/$USER/src | ||
|
||
# update PATH for local pip installs | ||
ENV PATH="$PATH:/home/$USER/.local/bin" | ||
|
||
# upgrade pip | ||
RUN python -m pip install --upgrade pip | ||
|
||
# copy assets | ||
COPY . . | ||
|
||
# install devcontainer requirements | ||
RUN pip install -e .[dev] | ||
|
||
# install docs requirements | ||
RUN pip install --no-cache-dir -r docs/requirements.txt | ||
|
||
# install pre-commit environments in throwaway Git repository | ||
# https://stackoverflow.com/a/68758943 | ||
RUN git init . && \ | ||
pre-commit install-hooks && \ | ||
rm -rf .git | ||
|
||
CMD sleep infinity | ||
|
||
ENTRYPOINT [] |
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
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
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