Skip to content

Commit

Permalink
Mise en place docker
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoub77200 committed Nov 12, 2024
1 parent b083830 commit 901ee09
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Download sources
uses: actions/checkout@v4
- name: Set up NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
run: |
cd frontend
npm install
- name: Build frontend
run: |
cd frontend
npm run build
- name: Start frontend
run: |
docker compose up --detach
- name: Wait for frontend
uses: docker://benel/wait-for-response:1
with:
args: http://localhost/ 200 30000 500
- name: Watch frontend initial payload
run: curl --silent localhost
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
static_hosting:
image: nginx
volumes:
- ./frontend/dist:/usr/share/nginx/html:ro
- ./settings/nginx.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- 80:80
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions settings/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
server {
location / {
root /usr/share/nginx/html;
try_files $uri /index.html; #Emulate multi-page app
}
}

0 comments on commit 901ee09

Please sign in to comment.