moriire commited on
Commit
a152566
1 Parent(s): fe0a530

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -5
Dockerfile CHANGED
@@ -4,7 +4,6 @@ ARG IMAGE=python:3.10-slim-bullseye
4
  # Use the image as specified
5
  FROM ${IMAGE}
6
 
7
- USER root
8
  # Re-declare the ARG after FROM
9
  ARG IMAGE
10
 
@@ -27,7 +26,9 @@ WORKDIR /app
27
  COPY . .
28
 
29
  # Set up a new user named "user" with user ID 1000
30
- #RUN useradd -u 1000 user
 
 
31
 
32
  #RUN useradd -ms /bin/bash user
33
  #RUN addgroup -g 1001 -S 1000
@@ -41,11 +42,11 @@ ENV TF_ENABLE_ONEDNN_OPTS=0
41
 
42
 
43
  # Switch to the "user" user
44
- #USER user
45
  # Set home to the user's home directory
46
 
47
- #ENV HOME=/home/user \
48
- #PATH=/home/user/.local/bin:$PATH/app
49
 
50
  #RUN export MYSQLCLIENT_CFLAGS=`pkg-config mysqlclient --cflags`
51
  #RUN export MYSQLCLIENT_LDFLAGS=`pkg-config mysqlclient --libs`
 
4
  # Use the image as specified
5
  FROM ${IMAGE}
6
 
 
7
  # Re-declare the ARG after FROM
8
  ARG IMAGE
9
 
 
26
  COPY . .
27
 
28
  # Set up a new user named "user" with user ID 1000
29
+ RUN useradd -u 1000 user
30
+
31
+ RUN chown -R nonroot:nonroot .
32
 
33
  #RUN useradd -ms /bin/bash user
34
  #RUN addgroup -g 1001 -S 1000
 
42
 
43
 
44
  # Switch to the "user" user
45
+ USER user
46
  # Set home to the user's home directory
47
 
48
+ ENV HOME=/home/user \
49
+ PATH=/home/user/.local/bin:$PATH/app
50
 
51
  #RUN export MYSQLCLIENT_CFLAGS=`pkg-config mysqlclient --cflags`
52
  #RUN export MYSQLCLIENT_LDFLAGS=`pkg-config mysqlclient --libs`