tester-dev commited on
Commit
eb6e210
·
verified ·
1 Parent(s): 9d77c08

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +0 -9
Dockerfile CHANGED
@@ -1,33 +1,24 @@
1
- # Start from your clean, pre-built application image.
2
  FROM testenv591/backend-api:12
3
 
4
- # --- SETUP AS ROOT ---
5
  USER root
6
 
7
- # Install Nginx
8
  RUN apk add --no-cache nginx
9
 
10
- # Create necessary directories
11
  RUN mkdir -p /var/cache/nginx \
12
  /var/log/nginx \
13
  /var/lib/nginx/logs \
14
  /var/lib/nginx/tmp \
15
  /run
16
 
17
- # Adjust ownership to the non-root user (UID 1000)
18
  RUN chown -R 1000:1000 /var/cache/nginx \
19
  /var/log/nginx \
20
  /var/lib/nginx \
21
  /run
22
 
23
- # Touch the PID file and set ownership
24
  RUN touch /run/nginx.pid && chown 1000:1000 /run/nginx.pid
25
 
26
- # Copy Nginx configuration (ensure it uses /run/nginx.pid)
27
  COPY --chown=root nginx.conf /etc/nginx/nginx.conf
28
 
29
- # Switch to the non-root user before running CMD
30
  USER 1000
31
 
32
- # Start Nginx and the backend server
33
  CMD ["sh", "-c", "nginx -g 'daemon off;' & exec npm start"]
 
 
1
  FROM testenv591/backend-api:12
2
 
 
3
  USER root
4
 
 
5
  RUN apk add --no-cache nginx
6
 
 
7
  RUN mkdir -p /var/cache/nginx \
8
  /var/log/nginx \
9
  /var/lib/nginx/logs \
10
  /var/lib/nginx/tmp \
11
  /run
12
 
 
13
  RUN chown -R 1000:1000 /var/cache/nginx \
14
  /var/log/nginx \
15
  /var/lib/nginx \
16
  /run
17
 
 
18
  RUN touch /run/nginx.pid && chown 1000:1000 /run/nginx.pid
19
 
 
20
  COPY --chown=root nginx.conf /etc/nginx/nginx.conf
21
 
 
22
  USER 1000
23
 
 
24
  CMD ["sh", "-c", "nginx -g 'daemon off;' & exec npm start"]