-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.test
34 lines (25 loc) · 919 Bytes
/
Dockerfile.test
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
FROM python:3.9.0-buster
RUN apt-get update
RUN pip install --upgrade pip
ENV APP_USER twilio
ENV FLASK_APP deadshot
ENV APP_DIR /home/twilio/app/deadshot
ENV APP_INSTALL_DIR /app/deadshot
RUN mkdir -p /home/twilio
RUN groupadd -r twilio &&\
useradd -r -g twilio -d /home/twilio -s /sbin/nologin -c "Twilio Docker image user" twilio
RUN chown twilio /home/twilio
RUN chgrp twilio /home/twilio
RUN mkdir -p $APP_INSTALL_DIR
COPY requirements.txt $APP_INSTALL_DIR
RUN pip install -r $APP_INSTALL_DIR/requirements.txt
COPY tests/test_requirements.txt $APP_INSTALL_DIR
RUN pip install -r $APP_INSTALL_DIR/test_requirements.txt
COPY deadshot $APP_INSTALL_DIR
COPY bin $APP_INSTALL_DIR
USER $APP_USER
RUN mkdir -p $APP_DIR
ADD --chown=twilio:twilio ./deadshot $APP_DIR/deadshot
ADD --chown=twilio:twilio ./tests $APP_DIR/tests
WORKDIR $APP_DIR
CMD (pytest -v -s && pycodestyle -v --max-line-length=180 deadshot)