forked from cloudforet-io/console-api-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (27 loc) · 924 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
31
32
33
34
35
FROM cloudforet/python-core:2.0
ARG PACKAGE_VERSION
ARG BRANCH_NAME=master
ENV PYTHONUNBUFFERED=1
ENV SPACEONE_PORT=8000
ENV SRC_DIR=/tmp/src
ENV CONF_DIR=/etc/spaceone
ENV LOG_DIR=/var/log/spaceone
ENV GIT_DIR=/tmp/git
ENV OPENAPI_JSON_DIR=/opt/openapi
ENV PACKAGE_VERSION=$PACKAGE_VERSION
COPY pkg/pip_requirements.txt pip_requirements.txt
RUN pip install --upgrade pip && \
pip install --upgrade -r pip_requirements.txt
RUN apt-get update && apt-get install -y git
RUN mkdir -p ${OPENAPI_JSON_DIR}
WORKDIR ${GIT_DIR}
RUN git clone --branch ${BRANCH_NAME} https://github.com/cloudforet-io/api.git
RUN cp -r api/dist/openapi/* ${OPENAPI_JSON_DIR}
RUN rm -rf ${GIT_DIR}
COPY src ${SRC_DIR}
WORKDIR ${SRC_DIR}
RUN python3 setup.py install && rm -rf /tmp/*
RUN pip install --upgrade spaceone-api
EXPOSE ${SPACEONE_PORT}
ENTRYPOINT ["spaceone"]
CMD ["run", "rest-server", "cloudforet.console_api_v2", "-m", "/opt"]