-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (28 loc) · 911 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM python:3.11
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
USER=calitp
# create $USER and home directory
RUN useradd --create-home --shell /bin/bash $USER && \
chown -R $USER /home/$USER
# switch to non-root $USER
USER $USER
# update PATH for local pip installs
ENV PATH "$PATH:/home/$USER/.local/bin"
RUN python -m pip install --upgrade pip
# enter src directory
WORKDIR /home/$USER/src
# install docs tooling:
COPY docs/requirements.txt docs/requirements.txt
RUN pip install --no-cache-dir -r docs/requirements.txt
# install python dependencies
COPY eligibility_api eligibility_api
COPY pyproject.toml pyproject.toml
RUN pip install -e .[dev,test]
# install pre-commit environments in throwaway Git repository
# https://stackoverflow.com/a/68758943
COPY .pre-commit-config.yaml .
RUN git init . && \
pre-commit install-hooks && \
rm -rf .git
CMD ["sleep", "infinity"]