Anuj-Panthri commited on
Commit
d84365c
·
1 Parent(s): 86f9b5d

dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -6
Dockerfile CHANGED
@@ -9,13 +9,23 @@ FROM python:3.7-alpine
9
  # RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python3 pip vim mc wget curl
10
 
11
 
 
 
 
 
 
 
 
 
 
12
 
13
 
14
  EXPOSE 8000
15
- WORKDIR /app
16
- COPY requirements.txt /app
17
  RUN pip3 install -r requirements.txt --no-cache-dir
18
- COPY . /app
 
19
 
20
  # RUN groupadd -r user && useradd -r -g user user
21
 
@@ -27,9 +37,9 @@ RUN ls -lh
27
  # USER user
28
 
29
 
30
- RUN python3 manage.py makemigrations;\
31
- python3 manage.py migrate;
32
 
33
- RUN ls -lh
34
 
35
  CMD python3 manage.py runserver 0.0.0.0:8000
 
9
  # RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python3 pip vim mc wget curl
10
 
11
 
12
+ RUN useradd -m -u 1000 user
13
+ USER user
14
+ # Set home to the user's home directory
15
+ ENV HOME=/home/user \
16
+ PATH=/home/user/.local/bin:$PATH
17
+ WORKDIR $HOME/app
18
+ COPY --chown=user . $HOME/app
19
+ RUN chown user:user -R $HOME/app
20
+
21
 
22
 
23
  EXPOSE 8000
24
+ # WORKDIR /app
25
+ # COPY requirements.txt /app
26
  RUN pip3 install -r requirements.txt --no-cache-dir
27
+ # COPY . /app
28
+
29
 
30
  # RUN groupadd -r user && useradd -r -g user user
31
 
 
37
  # USER user
38
 
39
 
40
+ # RUN python3 manage.py makemigrations;\
41
+ # python3 manage.py migrate;
42
 
43
+ # RUN ls -lh
44
 
45
  CMD python3 manage.py runserver 0.0.0.0:8000