File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,16 @@ RUN npm run build
1313
1414# production environment
1515FROM docker-registry.ebrains.eu/neuralactivity/nginx:stable-alpine
16+
17+ # Make nginx dirs writable for non-root user (UID 1001)
18+ RUN chown -R 1001:0 /var/cache/nginx /var/log/nginx /etc/nginx/conf.d && \
19+ chmod -R g+w /var/cache/nginx /var/log/nginx /etc/nginx/conf.d && \
20+ sed -i 's/^user nginx;/#user nginx;/' /etc/nginx/nginx.conf && \
21+ sed -i 's|/var/run/nginx.pid|/tmp/nginx.pid|' /etc/nginx/nginx.conf
22+
1623COPY deployment/nginx_default /etc/nginx/conf.d/default.conf
1724COPY --from=build /app/dist /usr/share/nginx/html
18- EXPOSE 80
25+
26+ EXPOSE 8080
27+ USER 1001
1928CMD ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change @@ -23,16 +23,16 @@ log_format anonymized '$ip_anonymized - $remote_user [$time_local] '
2323'"$http_referer" "$http_user_agent"';
2424
2525access_log off;
26- error_log off ;
26+ error_log /dev/null ;
2727
2828server {
2929 root /usr/share/nginx/html;
3030 index index.html;
3131
32- listen 80 ;
32+ listen 8080 ;
3333
34- access_log /var/log/nginx/access.log anonymized;
35- error_log /var/log/nginx/error.log crit;
34+ access_log /dev/stdout anonymized;
35+ error_log /dev/stderr crit;
3636
3737 location / {
3838 try_files $uri /index.html;
You can’t perform that action at this time.
0 commit comments