-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (26 loc) · 943 Bytes
/
Dockerfile
File metadata and controls
35 lines (26 loc) · 943 Bytes
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
FROM python:3.7-slim AS builder
LABEL Name="Inspector Version=0.1.0"
# Keep Python from generating .pyc files in the container and
# turn off buffering for easier container logging
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
COPY requirements/ /opt/inspector/requirements
COPY ./inspector/ /opt/inspector
COPY ./.env /opt
COPY ./run.py /opt
WORKDIR /opt
# ============ PRODUCTION ENV ============
FROM builder AS production
RUN python -m pip install -r /opt/inspector/requirements/prod.txt
CMD /bin/bash -c "python run.py"
# ============ TESTING ENV ============
FROM builder AS testing
COPY ./tests /opt/tests
COPY ./test.sh /opt
RUN python -m pip install -r /opt/inspector/requirements/test.txt
CMD ["./test.sh"]
# ============ DEVELOPMENT ENV ============
FROM builder AS development
COPY ./tests /opt/tests
RUN python -m pip install -r /opt/inspector/requirements/dev.txt
CMD /bin/bash -c "python run.py"