-
Notifications
You must be signed in to change notification settings - Fork 29
/
Dockerfile
34 lines (31 loc) · 1.22 KB
/
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
# This Dockerfile creates all-in-one image - for now.sh for example.
# It's pretty messy - it's for demonstration purposes only.
# Real deployment should have separate images for each component - frontend and backend.
FROM node:10-stretch AS build_frontend
COPY frontend/package.json frontend/package-lock.json /frontend/
RUN cd /frontend && npm install
COPY frontend /frontend
RUN cd /frontend && npm run build
FROM python:3.7-stretch AS build_backend
RUN python3 -m venv /venv
RUN /venv/bin/pip install --upgrade pip wheel
COPY backend/requirements.txt /backend/
RUN /venv/bin/pip install -r /backend/requirements.txt
COPY backend /backend/
RUN /venv/bin/pip install /backend
FROM debian:stretch
ENV DEBIAN_FRONTEND=noninteractive ALLOW_DEV_LOGIN=1 BACKEND_PROXY=1
RUN apt-get update
RUN apt-get install -y libexpat1
COPY --from=mongo:3.6-jessie /usr/bin/mongod /usr/bin/
COPY --from=mongo:3.6-jessie /usr/lib /usr/lib
COPY --from=build_frontend /usr/local /usr/local
COPY --from=build_frontend /frontend /frontend
COPY --from=build_backend /usr/local /usr/local
COPY --from=build_backend /usr/lib /usr/lib
COPY --from=build_backend /venv /venv
COPY data /data
RUN ldconfig
COPY docker_entrypoint.sh /
EXPOSE 3000
CMD ["/docker_entrypoint.sh"]