Skip to content

Commit

Permalink
Merge pull request #697 from f5devcentral/nginx-unpriv
Browse files Browse the repository at this point in the history
switch to the unprivileged nginx container for spa web server
  • Loading branch information
aknot242 authored Aug 5, 2023
2 parents fbb5186 + e41603f commit ae1f4f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
VITE_APP_GLOBAL_BACKGROUND_COLOR: "#FFF"
container_name: spa
ports:
- "8081:80"
- "8081:8080"
links:
- api
restart: unless-stopped
Expand All @@ -48,7 +48,7 @@ services:
VITE_APP_GLOBAL_BACKGROUND_COLOR: "#000"
container_name: spa-dark
ports:
- "8082:80"
- "8082:8080"
links:
- api
restart: unless-stopped
Expand Down
4 changes: 2 additions & 2 deletions spa/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ ENV VITE_APP_GLOBAL_COLOR $VITE_APP_GLOBAL_COLOR
RUN npm run build

# --------- Release ---------
FROM nginx:stable-alpine as release
FROM nginxinc/nginx-unprivileged:stable-alpine as release

COPY --from=builder /app/dist /usr/share/nginx/html
COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf

EXPOSE 80
EXPOSE 8080

CMD ["nginx", "-g", "daemon off;"]
5 changes: 2 additions & 3 deletions spa/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
pid /tmp/nginx.pid;
events {
worker_connections 1024;
}
Expand All @@ -16,7 +15,7 @@ http {
sendfile on;
keepalive_timeout 65;
server {
listen 80;
listen 8080;
server_name _ default_server;
index index.html;
location / {
Expand Down

0 comments on commit ae1f4f0

Please sign in to comment.