Skip to content

Commit

Permalink
Merge pull request #15 from frontend-park-mail-ru/testingWebpack
Browse files Browse the repository at this point in the history
Testing webpack
  • Loading branch information
AlexandraSmirnova authored Dec 16, 2024
2 parents c14459a + d3f5b3c commit 2fcdb36
Show file tree
Hide file tree
Showing 70 changed files with 7,580 additions and 5,355 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yml
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
5 changes: 3 additions & 2 deletions .gitignore
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/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Frontend проекта "KudaGo" Команда 7
* [Backend](https://github.com/go-park-mail-ru/2024_2_Team7)

# Проект
* [vyhodnoy.ru](http://37.139.40.252/)
* [vyhodnoy.online](https://vyhodnoy.online/events)

# figma
* https://www.figma.com/design/B9I0SPwTjYkMcqq6MwO2jW/kudaGo?node-id=0-1&t=DndAvQ4zTz4isemp-1
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
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
26 changes: 11 additions & 15 deletions dockerfile
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"]
Loading

0 comments on commit 2fcdb36

Please sign in to comment.