-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.py2alpine
39 lines (31 loc) · 1.22 KB
/
Dockerfile.py2alpine
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
39
FROM python:2.7.12-alpine
MAINTAINER Madison Bahmer <madison.bahmer@istresearch.com>
# copy ui own requirements.txt with its dependencies
COPY ui/requirements.txt /usr/src/app/
# Combine run command to create single intermeiate image layer
# This MANDATORY because developments dependencies are huge.
RUN mkdir -p /usr/src/app \
&& cd /usr/src/app \
# Installing runtime dependencies
&& apk --no-cache add \
curl \
# Installing buildtime dependencies. They will be removed at end of this
# commands sequence.
&& apk --no-cache add --virtual build-dependencies \
build-base \
# Updating pip itself before installing packages from requirements.txt
&& pip install --no-cache-dir pip setuptools \
# Installing pip packages from requirements.txt
&& pip install --no-cache-dir -r requirements.txt \
# Removing build dependencies leaving image layer clean and neat
&& apk del build-dependencies
# move codebase over
COPY ui /usr/src/app
WORKDIR /usr/src/app
# override settings via localsettings.py
COPY docker/ui/settings.py /usr/src/app/localsettings.py
# copy testing script into container
COPY docker/run_docker_tests.sh /usr/src/app/run_docker_tests.sh
# set up environment variables
# run command
CMD ["python", "ui_service.py"]