mingyang91 commited on
Commit
5e5763a
·
verified ·
1 Parent(s): 4ebc768

try to grant user can access `/.cache` folder

Browse files
Files changed (2) hide show
  1. .idea/workspace.xml +13 -4
  2. Dockerfile +10 -3
.idea/workspace.xml CHANGED
@@ -4,7 +4,7 @@
4
  <option name="autoReloadType" value="SELECTIVE" />
5
  </component>
6
  <component name="ChangeListManager">
7
- <list default="true" id="d7806539-b6d6-42e7-bb45-1565f5d54891" name="Changes" comment="remove cv2">
8
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
9
  <change beforePath="$PROJECT_DIR$/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />
10
  </list>
@@ -118,7 +118,7 @@
118
  <option name="presentableId" value="Default" />
119
  <updated>1702301546100</updated>
120
  <workItem from="1702301554378" duration="4025000" />
121
- <workItem from="1702450051021" duration="3093000" />
122
  </task>
123
  <task id="LOCAL-00001" summary="init commit">
124
  <option name="closed" value="true" />
@@ -152,7 +152,15 @@
152
  <option name="project" value="LOCAL" />
153
  <updated>1702452468199</updated>
154
  </task>
155
- <option name="localTasksCounter" value="5" />
 
 
 
 
 
 
 
 
156
  <servers />
157
  </component>
158
  <component name="TypeScriptGeneratedFilesManager">
@@ -162,7 +170,8 @@
162
  <MESSAGE value="init commit" />
163
  <MESSAGE value="fix build" />
164
  <MESSAGE value="remove cv2" />
165
- <option name="LAST_COMMIT_MESSAGE" value="remove cv2" />
 
166
  </component>
167
  <component name="com.intellij.coverage.CoverageDataManagerImpl">
168
  <SUITE FILE_PATH="coverage/detector$demo.coverage" NAME="demo Coverage Results" MODIFIED="1702302380580" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
 
4
  <option name="autoReloadType" value="SELECTIVE" />
5
  </component>
6
  <component name="ChangeListManager">
7
+ <list default="true" id="d7806539-b6d6-42e7-bb45-1565f5d54891" name="Changes" comment="try to create /.cache folder">
8
  <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
9
  <change beforePath="$PROJECT_DIR$/Dockerfile" beforeDir="false" afterPath="$PROJECT_DIR$/Dockerfile" afterDir="false" />
10
  </list>
 
118
  <option name="presentableId" value="Default" />
119
  <updated>1702301546100</updated>
120
  <workItem from="1702301554378" duration="4025000" />
121
+ <workItem from="1702450051021" duration="3998000" />
122
  </task>
123
  <task id="LOCAL-00001" summary="init commit">
124
  <option name="closed" value="true" />
 
152
  <option name="project" value="LOCAL" />
153
  <updated>1702452468199</updated>
154
  </task>
155
+ <task id="LOCAL-00005" summary="try to create /.cache folder">
156
+ <option name="closed" value="true" />
157
+ <created>1702453169015</created>
158
+ <option name="number" value="00005" />
159
+ <option name="presentableId" value="LOCAL-00005" />
160
+ <option name="project" value="LOCAL" />
161
+ <updated>1702453169015</updated>
162
+ </task>
163
+ <option name="localTasksCounter" value="6" />
164
  <servers />
165
  </component>
166
  <component name="TypeScriptGeneratedFilesManager">
 
170
  <MESSAGE value="init commit" />
171
  <MESSAGE value="fix build" />
172
  <MESSAGE value="remove cv2" />
173
+ <MESSAGE value="try to create /.cache folder" />
174
+ <option name="LAST_COMMIT_MESSAGE" value="try to create /.cache folder" />
175
  </component>
176
  <component name="com.intellij.coverage.CoverageDataManagerImpl">
177
  <SUITE FILE_PATH="coverage/detector$demo.coverage" NAME="demo Coverage Results" MODIFIED="1702302380580" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
Dockerfile CHANGED
@@ -1,7 +1,14 @@
1
  FROM python:3.11-bookworm
 
 
 
 
 
 
 
 
 
 
2
 
3
- WORKDIR /app
4
- COPY . /app
5
  RUN pip install -r requirements.txt
6
- RUN mkdir /.cache
7
  ENTRYPOINT ["streamlit", "run", "demo.py"]
 
1
  FROM python:3.11-bookworm
2
+ RUN useradd -m -u 1000 user
3
+ USER user
4
+ # Set home to the user's home directory
5
+ ENV HOME=/home/user \
6
+ PATH=/home/user/.local/bin:$PATH
7
+ # Set the working directory to the user's home directory
8
+ WORKDIR $HOME/app
9
+ COPY . $HOME/app
10
+ RUN mkdir $HOME/.cache
11
+ RUN chown -R user $HOME/.cache
12
 
 
 
13
  RUN pip install -r requirements.txt
 
14
  ENTRYPOINT ["streamlit", "run", "demo.py"]