Skip to content

Commit

Permalink
Add basic docker container for front-end.
Browse files Browse the repository at this point in the history
  • Loading branch information
daemontus committed Nov 9, 2023
1 parent fa34e39 commit 13bac65
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
name: Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -22,4 +21,31 @@ jobs:
run: docker build -t daemontus/bbm-backend .
- name: Push image
working-directory: backend
run: docker push daemontus/bbm-backend
run: docker push daemontus/bbm-backend

frontend:
name: Build frontend image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Add Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install dependencies
working-directory: frontend
run: npm install
- name: Build frontend
working-directory: frontend
run: npm run build
- name: Build image
working-directory: frontend
run: docker build -t daemontus/bbn-frontend .
- name: Push image
working-directory: frontend
run: docker push daemontus/bbm-frontend
4 changes: 4 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nginx:1.24.0

COPY nginx.conf /etc/nginx/nginx.conf
COPY ./dist /www
16 changes: 16 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
events {
# configuration of connection processing
}

http {
server {
listen 80;
server_name bbm.unsigned-short.com;

root /www;

location / {
include /etc/nginx/mime.types;
}
}
}

0 comments on commit 13bac65

Please sign in to comment.