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