forked from DarciaIV/vue-paper-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (29 loc) · 1.18 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
# use node:8.11.3 as base image
FROM node:8.11.3 as builder
# create workdir
WORKDIR /app
# copy package.json and package-lock.json
COPY package.json package-lock.json ./
# install dependencies
RUN npm install
# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . .
# build project
RUN npm run build
RUN ls -la
# use nginx:alpine
FROM nginx:alpine
# Оновлення індексу пакетів і встановлення Nginx
RUN apk update && apk add nginx
# Видалення стандартної сторінки Nginx
RUN rm -rf /usr/share/nginx/html/*
# Копіюємо артефакт (dist) у каталог Nginx
COPY --from=builder /app/dist/ /usr/share/nginx/html/
# Видаляємо попередню конфігурацію Nginx що стоїть по замовчуванню
RUN rm -f /etc/nginx/http.d/default.conf
# Завантажуємо власну конфігурацію Nginx в образ
COPY ./oleksapp.conf /etc/nginx/http.d/
# Відкриваємо порт 80 для HTTP
EXPOSE 80
# Запускаємо Nginx у фоновому режимі при запуску контейнера
CMD ["nginx", "-g", "daemon off;"]