-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
47 lines (32 loc) · 898 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
43
44
45
46
47
ARG PYTHON_VERSION=3.10-slim-buster
ARG NODE_VERSION=18-bullseye
FROM node:$NODE_VERSION as node_modules
WORKDIR /opt
COPY package.json package-lock.json /opt/
RUN mkdir -p node_modules && npm install --ignore-scripts
FROM python:$PYTHON_VERSION
ARG ENVIRONMENT=production
ARG VERSION=latest
ENV PYTHONUNBUFFERED=1
ENV DB_HOSTNAME=db
ENV DB_USERNAME=mosp
ENV DB_PASSWORD=mosp
WORKDIR /app
COPY requirements.txt /app/
RUN pip install gunicorn[gevent]
RUN pip install -r requirements.txt
COPY mosp/ /app/mosp/
COPY contrib/ /app/contrib/
COPY instance/ /app/instance/
COPY migrations/ /app/migrations/
COPY --from=node_modules /opt/node_modules/ mosp/static/npm_components/
RUN pybabel compile -d mosp/translations
COPY app.py .
COPY entrypoint.sh .
ENV MOSP_VERSION=latest
ENV HOST=0.0.0.0
ENV PORT=5000
ENV MOSP_CONFIG=docker.py
VOLUME [ "/app/var" ]
EXPOSE 5000
CMD ./entrypoint.sh