Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to the unprivileged nginx container for spa web server #697

Merged
merged 1 commit into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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