Skip to content

Commit

Permalink
Merge pull request #21 from vasgat/staging
Browse files Browse the repository at this point in the history
Update workflow and dockerfile
  • Loading branch information
vasgat authored Nov 22, 2024
2 parents db6b019 + aafe61f commit c05189d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Build and publish Docker image
on:
push:
branches: [ main, staging ]
paths:
- 'dist/**'
- 'docker/**'

jobs:
build-and-push-image:
Expand Down
3 changes: 3 additions & 0 deletions docker/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ FROM nginx:latest
# Copy your static site files to the Nginx default directory
COPY ../dist/msa-dashboard /usr/share/nginx/html

# Copy custom Nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf

# Expose port 80 to allow traffic
EXPOSE 80

Expand Down
29 changes: 29 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
worker_processes 1;

events { worker_connections 1024; }

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;

server {
listen 80;
server_name localhost;

root /usr/share/nginx/html;

# Serve Angular routes correctly
location / {
try_files $uri $uri/ /index.html;
}

# Optional: Cache static files
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
try_files $uri =404;
expires 1M;
add_header Cache-Control "public";
}
}
}

0 comments on commit c05189d

Please sign in to comment.