-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
80 lines (58 loc) · 2.13 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# BUILD
# =====
FROM ubuntu:trusty as buildstep
COPY resources/docker/sources.list /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:jonathonf/python-3.6
RUN apt-get update
RUN apt-get install -y python3.6 python3.6-dev libmysqlclient-dev curl build-essential git
RUN mkdir -p /build/wheels
RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
RUN pip3 install --upgrade pip setuptools wheel
ADD requirements.txt /tmp/requirements.txt
#RUN pip wheel -r /tmp/requirements.txt --no-binary MySQL-python --wheel-dir=/build/wheels
RUN pip3 wheel -r /tmp/requirements.txt --wheel-dir=/build/wheels
# DEPLOY
# =====
FROM ubuntu:trusty as deploystep
COPY resources/docker/sources.list /etc/apt/sources.list
RUN apt-get update \
&& apt-get install -y software-properties-common curl \
&& add-apt-repository -y ppa:jonathonf/python-3.6 \
&& apt-get update \
&& apt-get install -y python3.6 libmysqlclient-dev vim-tiny --no-install-recommends \
&& apt-get clean \
&& curl https://bootstrap.pypa.io/get-pip.py | python3.6 \
&& pip3 install --upgrade pip setuptools wheel \
&& rm -rf /var/lib/apt/lists/*
#RUN apt-get update \
# && apt-get install -y python3 libmysqlclient-dev vim-tiny python3-pip --no-install-recommends \
# && apt-get clean \
# && pip3 install --upgrade pip setuptools wheel \
# && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /config
RUN mkdir -p /data
VOLUME /config
VOLUME /data
# Place app source in container.
COPY . /app
WORKDIR /app
COPY --from=buildstep /build/wheels /tmp/wheels
RUN pip3 install /tmp/wheels/*
# Install app symlinks (this works better right now than python setup.py install,
# since there are some scripts that assume they are running from app directory.)
RUN python3.6 setup.py develop
EXPOSE 5000
ENV BAFS_SETTINGS=/config/settings.cfg
# There are lots of uses for this image, so we don't specify an entrypoint.
# Available commands are basically any of the scripts:
# bafs-init-db
# bafs-sync
# bafs-sync-detail
# bafs-sync-streams
# bafs-sync-photos
# bafs-sync-weather
# bafs-sync-athletes
# bafs-server
# ENTRYPOINT bafs-server