umgefahren commited on
Commit
f3e4c57
·
1 Parent(s): 9199381

Permissionless user

Browse files
Files changed (2) hide show
  1. .gitignore +4 -1
  2. Dockerfile +15 -1
.gitignore CHANGED
@@ -2,4 +2,7 @@
2
  polygons_processing/output.geojson
3
  detectree2/data/
4
  detectree2/models/
5
- detectree2/predictions/train_outputs
 
 
 
 
2
  polygons_processing/output.geojson
3
  detectree2/data/
4
  detectree2/models/
5
+ detectree2/predictions/train_outputs
6
+
7
+ .env/
8
+ __pycache__/
Dockerfile CHANGED
@@ -17,6 +17,15 @@ RUN apt-get install -t unstable -y gdal-bin libgdal-dev
17
 
18
  RUN conda install -y python=3.10
19
 
 
 
 
 
 
 
 
 
 
20
  RUN python -m pip install torchvision torch
21
  RUN python -m pip install git+https://github.com/facebookresearch/detectron2.git
22
  RUN python -m pip install torchvision torch rasterio
@@ -26,10 +35,15 @@ RUN python -m pip install requests
26
 
27
  RUN python -m pip install gradio
28
 
29
- COPY . .
30
 
31
  ENV TORCH_HOME /tmp/torch
32
  ENV MPLCONFIGDIR /tmp/matplotlib
33
 
 
 
 
 
 
34
 
35
  CMD ["python", "main.py"]
 
17
 
18
  RUN conda install -y python=3.10
19
 
20
+ RUN useradd -m -u 1000 user
21
+
22
+ USER user
23
+
24
+ ENV HOME=/home/user \
25
+ PATH=/home/user/.local/bin:$PATH
26
+
27
+ WORKDIR $HOME/app
28
+
29
  RUN python -m pip install torchvision torch
30
  RUN python -m pip install git+https://github.com/facebookresearch/detectron2.git
31
  RUN python -m pip install torchvision torch rasterio
 
35
 
36
  RUN python -m pip install gradio
37
 
38
+ COPY --chown=user . $HOME/app
39
 
40
  ENV TORCH_HOME /tmp/torch
41
  ENV MPLCONFIGDIR /tmp/matplotlib
42
 
43
+ RUN mkdir -m 700 -p /home/user/app/cache
44
+
45
+ RUN mkdir -p /data
46
+
47
+ RUN chmod 777 /data
48
 
49
  CMD ["python", "main.py"]