Dockerfile 672 Bytes
Newer Older
1
ARG VERSION=1.3
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use a multi stage build : first compile and minify JS files, then serve them with a simple nginx
FROM node:14-alpine as build

ARG VERSION
RUN apk add --no-cache unzip

# Get the release
RUN wget -O /tmp/impactometre.zip https://github.com/impactometre/impactometre-front/archive/${VERSION}.zip

# Install dependencies and build Vue app
RUN unzip -d /tmp /tmp/impactometre.zip && \
    cd /tmp/impactometre-front-${VERSION} && \
    npm install && \
    npm run build

FROM nginx:1.19
ARG VERSION

WORKDIR /usr/share/nginx/html

# Only copy built files and serve them in /usr/share/nginx/html
COPY --from=build /tmp/impactometre-front-${VERSION}/dist/ .