forked from threefoldtecharchive/tfgrid_dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 671 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 671 Bytes
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
# stage 1
FROM node:14.17.0-alpine as build
WORKDIR /app
# Copy vue app source code
COPY . /app/
# Install yarn and build project
RUN yarn cache clean
RUN yarn install
RUN npm run build
# stage 2
FROM nginx:1.16.0-alpine
# Copy dist from stage(1)
COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=build /app/scripts/build-env.sh /usr/share/nginx/html
# Add custom nginx conf
RUN rm /etc/nginx/conf.d/default.conf
COPY /nginx.conf /etc/nginx/conf.d
WORKDIR /usr/share/nginx/html
RUN apk add --no-cache bash
RUN chmod +x build-env.sh
# Serve the app
EXPOSE 80
CMD [ "/bin/bash", "-c", "/usr/share/nginx/html/build-env.sh && nginx -g \"daemon off;\"" ]