-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
38 lines (28 loc) · 1.36 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
35
36
37
FROM node:12
# Добавляем сертификат прокси в доверенные
# только в случае использования прокси-сервера
ADD squid.crt /usr/local/share/ca-certificates
RUN update-ca-certificates
# создание директории приложения и прав доступа
WORKDIR /usr/src/app
COPY --chown=node:node . .
# установка зависимостей
# символ астериск ("*") используется для того чтобы по возможности
# скопировать оба файла: package.json и package-lock.json
#COPY package*.json ./
# создание сборки для продакшн
#RUN npm ci --only=production
# копируем исходный код
COPY . .
# Устанавливаем зависимости, для запуска build под express
#RUN npm set strict-ssl false && npm install -g express-generator@4 && npm install express
# Устанавливаем зависимости, для запуска build под serve
RUN npm set strict-ssl false && npm install -g serve
# Проброс порта 3000
EXPOSE 3000
# пользователь для запуска
USER node
# Запуск по умолчанию c express
#CMD ["node", "node_run.js"]
# Запуск по умолчанию c serve
CMD ["serve","-s","build"]