forked from RedHat-Israel/ROSE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (30 loc) · 821 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
36
37
38
39
40
41
42
# Generate a container that generates requirements.txt
ARG PY_VERSION=3.7
FROM python:${PY_VERSION} as source
ARG DEV
ENV ENABLE_PIPENV=true
# Install pipenv
RUN pip install --upgrade pipenv
COPY Pipfile ./Pipfile
# Generate requirements.txt file from Pipfile
RUN if [ -z ${DEV} ]; \
then \
pipenv lock -r > requirements.txt; \
else \
pipenv lock --dev -r > requirements.txt; \
fi
# Generate work image
ARG PY_VERSION
FROM python:${PY_VERSION}
# Project maintainer
LABEL maintainer="[email protected]"
# Copy pipfile to default WORKDIR
COPY --from=source requirements.txt ./requirements.txt
# Install dependencies
RUN pip install -r requirements.txt
# Copy application to default WORKDIR
COPY . ./
# Server port
EXPOSE 8880
# Server command
CMD [ "run", "python", "rose-server"]