Beracles commited on
Commit
2d056a7
·
1 Parent(s): c49509f

fix permission

Browse files
Files changed (2) hide show
  1. Dockerfile +12 -1
  2. app/watermelon.py +0 -1
Dockerfile CHANGED
@@ -3,12 +3,23 @@
3
 
4
  FROM python:3.10.5
5
 
6
- WORKDIR /code
 
7
 
 
 
 
 
 
 
 
 
 
8
 
9
  COPY ./requirements.txt /code/requirements.txt
10
 
11
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
12
 
13
  COPY . .
14
 
 
3
 
4
  FROM python:3.10.5
5
 
6
+ # Set up a new user named "user" with user ID 1000
7
+ RUN useradd -m -u 1000 user
8
 
9
+ # Switch to the "user" user
10
+ USER user
11
+
12
+ # Set home to the user's home directory
13
+ ENV HOME=/home/user \
14
+ PATH=/home/user/.local/bin:$PATH
15
+
16
+ # Set the working directory to the user's home directory
17
+ WORKDIR $HOME/code
18
 
19
  COPY ./requirements.txt /code/requirements.txt
20
 
21
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
22
+ RUN chmod 777 /code
23
 
24
  COPY . .
25
 
app/watermelon.py CHANGED
@@ -38,7 +38,6 @@ def submit(response: Response):
38
  marker = timestamp+".submit"
39
  filepath = "/".join([game, filename])
40
  markerpath = "/".join([game, marker])
41
- os.chmod("./",mode=511)
42
  if not os.path.exists(game):
43
  os.mkdir(game)
44
  with open(filepath, "w") as f:
 
38
  marker = timestamp+".submit"
39
  filepath = "/".join([game, filename])
40
  markerpath = "/".join([game, marker])
 
41
  if not os.path.exists(game):
42
  os.mkdir(game)
43
  with open(filepath, "w") as f: