forked from 5GEVE/mso-lo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (23 loc) · 800 Bytes
/
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
FROM python:3.6-slim as base
EXPOSE 5000
RUN apt-get update && apt-get install -y build-essential
RUN ["pip3", "install", "pipenv==2018.11.26"]
WORKDIR /usr/src/app
# copy only pipfiles to install dependencies
COPY ./adaptation_layer/Pipfile* ./
RUN ["pipenv", "install", "--system", "--ignore-pipfile", "--deploy"]
COPY ./adaptation_layer .
# setup env variables to initialize database
ARG DB_SEED_NFVO
ENV DB_SEED_NFVO $DB_SEED_NFVO
ARG DB_SEED_NFVO_CRED
ENV DB_SEED_NFVO_CRED $DB_SEED_NFVO_CRED
RUN ["rm", "-f", "data/mso-lo.db"]
RUN ["flask", "db", "upgrade"]
RUN ["python", "manage.py", "seed"]
FROM base as prod
COPY ./uWSGI/app.ini .
CMD ["uwsgi", "--ini", "app.ini"]
FROM base as test
RUN ["pipenv", "install", "--system", "--ignore-pipfile", "--deploy", "--dev"]
COPY ./openapi ./openapi