Skip to content

Commit 70be0e5

Browse files
authored
Merge pull request #28 from CSCfi/feature/docker-update
Docker stage for frontend node.js build
2 parents f0c9a63 + bc7f858 commit 70be0e5

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

Dockerfile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
FROM python:3.7-alpine3.9 as BUILD
1+
FROM node:12.10-alpine as FRONTEND
2+
3+
RUN apk add --update \
4+
&& apk add --no-cache build-base curl-dev linux-headers bash git\
5+
&& rm -rf /var/cache/apk/*
6+
7+
COPY swift_browser_ui_frontend /root/swift_ui/swift_browser_ui_frontend
8+
9+
RUN cd /root/swift_ui/swift_browser_ui_frontend \\
10+
&& npm install \\
11+
&& npm run build
12+
13+
FROM python:3.7-alpine3.9 as BACKEND
214

315
RUN apk add --update \
416
&& apk add --no-cache build-base curl-dev linux-headers bash git\
@@ -8,7 +20,7 @@ RUN apk add --update \
820
COPY requirements.txt /root/swift_ui/requirements.txt
921
COPY setup.py /root/swift_ui/setup.py
1022
COPY swift_browser_ui /root/swift_ui/swift_browser_ui
11-
COPY swift_browser_ui_frontend /root/swift_ui/swift_browser_ui_frontend
23+
COPY --from=FRONTEND /root/swift_ui/swift_browser_ui_frontend/dist /root/swift_ui/swift_browser_ui_frontend/dist
1224

1325
RUN pip install --upgrade pip && \
1426
pip install -r /root/swift_ui/requirements.txt && \
@@ -22,11 +34,11 @@ LABEL maintainer "CSC Developers"
2234
LABEL org.label-schema.schema-version="1.0"
2335
LABEL org.label-schema.vcs-url="https://github.com/CSCFI/swift-browser-ui"
2436

25-
COPY --from=BUILD usr/local/lib/python3.7/ usr/local/lib/python3.7/
37+
COPY --from=BACKEND usr/local/lib/python3.7/ usr/local/lib/python3.7/
2638

27-
COPY --from=BUILD /usr/local/bin/gunicorn /usr/local/bin/
39+
COPY --from=BACKEND /usr/local/bin/gunicorn /usr/local/bin/
2840

29-
COPY --from=BUILD /usr/local/bin/swift-browser-ui /usr/local/bin/
41+
COPY --from=BACKEND /usr/local/bin/swift-browser-ui /usr/local/bin/
3042

3143
RUN mkdir -p /app
3244

0 commit comments

Comments
 (0)