Skip to content

Instantly share code, notes, and snippets.

@lex111
Forked from praveenweb/4.node-ui-static.Dockerfile
Last active March 2, 2018 11:56
Show Gist options
  • Save lex111/e8e50c64a67664e2a7d653517cd384ae to your computer and use it in GitHub Desktop.
Save lex111/e8e50c64a67664e2a7d653517cd384ae to your computer and use it in GitHub Desktop.
FROM node:carbon
# Создать директорию app
WORKDIR /app
# Установить зависимости приложения
RUN npm -g install serve
# Используется символ подстановки для копирования как package.json, так и package-lock.json
COPY package*.json ./
RUN npm install
# Скопировать исходники приложения
COPY src /app
# Собрать статические файлы react/vue/angular
RUN npm run build
EXPOSE 8080
# Запуск сервера в директории dist на порту 8080
CMD ["serve", "-s", "dist", "-p", "8080"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment