Skip to content

Commit 61a2ef3

Browse files
committed
update deploy script and conf
1 parent f3e6af0 commit 61a2ef3

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

deploy/deploy.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ dzdo docker run -d --rm \
1111
--env-file .env \
1212
-p 80:80 -p 443:433 \
1313
--name resdeeds-web \
14-
-v ./etc/ssl:/etc/ssl
14+
-v ./etc/ssl:/etc/ssl \
15+
-v ./etc/nginx:/etc/nginx/conf.d \
16+
-v /var/log/nginx:/var/log/nginx \
1517
ghcr.io/idaholab/resdeeds/web:latest
1618

1719
echo "Deployed"

web/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ RUN ng build --configuration=production
2121

2222
FROM nginx:alpine
2323

24-
COPY etc/nginx.conf /etc/nginx/conf.d/default.conf
25-
2624
COPY --from=build /var/www/dist/resdeeds /usr/share/nginx/html
2725

2826
EXPOSE 80 443 4200

web/etc/nginx/default.conf

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
server {
2+
listen 443 ssl;
3+
server_name localhost;
4+
5+
# Path to SSL certificate and key
6+
ssl_certificate /etc/ssl/certs/localhost.cer;
7+
ssl_certificate_key /etc/ssl/private/localhost.key;
8+
9+
# Root directory for the Angular app
10+
root /usr/share/nginx/html;
11+
12+
# Default file to serve
13+
index index.html;
14+
15+
# Redirect HTTP traffic to HTTPS
16+
error_page 404 /index.html;
17+
18+
# Handle Angular's HTML5 pushState
19+
location / {
20+
try_files $uri $uri/ /index.html;
21+
}
22+
23+
# Optional: Gzip compression for improved performance
24+
gzip on;
25+
gzip_types text/plain application/javascript text/css application/json application/xml text/javascript;
26+
gzip_min_length 1024;
27+
}
28+
29+
30+
server {
31+
listen 80;
32+
server_name localhost;
33+
34+
# Serve static files from /usr/share/nginx/html
35+
location / {
36+
root /usr/share/nginx/html;
37+
index index.html index.htm;
38+
}
39+
40+
# Error pages
41+
error_page 500 502 503 504 /50x.html;
42+
location = /50x.html {
43+
root /usr/share/nginx/html;
44+
}
45+
}

0 commit comments

Comments
 (0)