-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (32 loc) · 1.43 KB
/
Dockerfile
File metadata and controls
48 lines (32 loc) · 1.43 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
44
45
46
47
48
# ================================================================= #
# ------------ First stage in our multistage Dockerfile ----------- #
# ================================================================= #
FROM python:3.6-slim as Base
RUN apt-get update \
&& apt-get install -y curl git
WORKDIR /home/ci-workshop-app
COPY requirements.txt /home/ci-workshop-app/requirements.txt
RUN pip install -r requirements.txt
COPY . /home/ci-workshop-app
# ================================================================= #
# ------------ Second stage in our multistage Dockerfile ---------- #
# ================================================================= #
FROM Base as Build
ARG CI
ENV CI=$CI
RUN /home/ci-workshop-app/bin/train_model.sh
# CMD ["/home/ci-workshop-app/bin/start_server.sh"]
# ================================================================= #
# ------------ Third stage in our multistage Dockerfile ----------- #
# ================================================================= #
FROM Build as Dev
RUN apt-get install -y gnupg \
&& curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
COPY requirements-dev.txt /home/ci-workshop-app/requirements-dev.txt
RUN pip install -r /home/ci-workshop-app/requirements-dev.txt
RUN git config --global credential.helper 'cache --timeout=36000'
EXPOSE 8080
ARG user
RUN useradd ${user:-root} -g root || true
USER ${user:-root}
# CMD ["/home/ci-workshop-app/bin/start_server.sh"]