Skip to content

Commit

Permalink
Merge pull request #3 from vasgat/staging
Browse files Browse the repository at this point in the history
Updates on workflow and dockerfile
  • Loading branch information
vasgat authored Nov 22, 2024
2 parents 7494b81 + 2b700d9 commit 2614155
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
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/apparel-top100-showcase /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 2614155

Please sign in to comment.