-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from frontend-park-mail-ru/testingWebpack
Testing webpack
- Loading branch information
Showing
70 changed files
with
7,580 additions
and
5,355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Deploy Frontend | ||
on: | ||
push: | ||
branches: | ||
- testingWebpack | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up SSH | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.VM_SSH_KEY }}" > ~/.ssh/id_ed25519 | ||
chmod 600 ~/.ssh/id_ed25519 | ||
echo "Host 37.139.40.252 | ||
StrictHostKeyChecking no" > ~/.ssh/config | ||
- name: Execute script on VM | ||
run: | | ||
ssh [email protected] 'bash -s' <<EOF | ||
cd front | ||
sudo git pull origin testingWebpack | ||
docker compose build | ||
docker compose up -d | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/node_modules | ||
/public/components/*/*.precompiled.js | ||
/public/config.js | ||
/public/src/components/*/*.precompiled.js | ||
/public/src/config.js | ||
/public/dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
services: | ||
frontend: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8000:8000" | ||
networks: | ||
- team7_network | ||
|
||
networks: | ||
team7_network: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
# Используем официальный образ Node.js версии 20 | ||
FROM node:20.17.0 | ||
FROM node:20-alpine | ||
|
||
# Устанавливаем рабочую директорию | ||
WORKDIR /app | ||
|
||
# Устанавливаем зависимости | ||
RUN npm install express --save | ||
# Сначала копируем только файлы package.json | ||
COPY package*.json ./ | ||
|
||
RUN npm i cors | ||
RUN npm install handlebars | ||
# Копируем остальные файлы приложения | ||
# Устанавливаем ВСЕ зависимости | ||
RUN npm install | ||
|
||
# Копируем остальные файлы | ||
COPY . . | ||
|
||
# Запускаем команду Handlebars | ||
RUN node ./node_modules/handlebars/bin/handlebars public/components/EditEventForm/EditEventForm.hbs -f public/components/EditEventForm/EditEventForm.precompiled.js || echo "Handlebars command failed" | ||
RUN node ./node_modules/handlebars/bin/handlebars public/components/EventCreateForm/EventCreateForm.hbs -f public/components/EventCreateForm/EventCreateForm.precompiled.js || echo "Handlebars command failed" | ||
RUN node ./node_modules/handlebars/bin/handlebars public/components/Login/Login.hbs -f public/components/Login/Login.precompiled.js || echo "Handlebars command failed" | ||
RUN node ./node_modules/handlebars/bin/handlebars public/components/Nav/Nav.hbs -f public/components/Nav/Nav.precompiled.js || echo "Handlebars command failed" | ||
RUN node ./node_modules/handlebars/bin/handlebars public/components/Register/Register.hbs -f public/components/Register/Register.precompiled.js || echo "Handlebars command failed" | ||
# Собираем приложение webpack'ом | ||
RUN npm run build | ||
|
||
# Открываем порт 80 | ||
EXPOSE 80 | ||
EXPOSE 8000 | ||
|
||
# Команда для запуска приложения | ||
CMD ["node", "server/server.js"] | ||
CMD ["npm", "start"] |
Oops, something went wrong.