-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (37 loc) · 1.19 KB
/
Dockerfile
File metadata and controls
43 lines (37 loc) · 1.19 KB
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
40
41
42
43
# Usage (given build times depend on machine):
#
# Build SMALL image (no cache; ~20MB, time for build=rebuild = ~360s):
# docker build --squash="true" -t pydemo:latest .
#
# Build FAST (rebuild) image (cache; >280MB, build time ~360s, rebuild time ~80s):
# docker build -t pydemo .
#
# Clean (remove intermediate images):
# docker rmi -f $(docker images -f "dangling=true" -q)
#
# Run image (on localhost:8080):
# docker run --name pydemo -p 8080:80 pydemo &
#
# Run image as virtual host (read more: https://github.com/jwilder/nginx-proxy):
# docker run -e VIRTUAL_HOST=pydemo.your-domain.com --name pydemo pydemo &
FROM python:3-alpine3.7
# install console and node
RUN apk update &&\
apk add --no-cache bash \
openssl \
make \
nodejs \
git &&\
mkdir -p /opt/app
# install pip ( in separate dir due to docker cache)
ADD setup.py /opt/app
RUN cd /opt/app && pip install -e .
# install nodejs dependencies ( in separate dir due to docker cache)
ADD package.json /opt/app
RUN cd /opt/app && npm install
WORKDIR /opt/app/src
ADD . /opt/app/src
VOLUME /opt/app/src
# this is for virtual host purposes
EXPOSE 3000 3001 8080 5000
CMD ["python", "demo/app.py"]