Kaballas commited on
Commit
15882cb
·
1 Parent(s): ed294ba
Files changed (1) hide show
  1. Dockerfile +4 -4
Dockerfile CHANGED
@@ -2,8 +2,7 @@
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
  FROM python:3.9
5
- # Create /run/mysqld and set permissions BEFORE switching users
6
- RUN mkdir -p /run/mysqld && chown user:user /run/mysqld
7
  # Switch to root user to perform administrative tasks
8
  USER root
9
 
@@ -20,6 +19,9 @@ RUN mkdir -p /data/storage \
20
  RUN useradd -m -u 1000 user \
21
  && chown -R user:user /data/storage
22
 
 
 
 
23
  # Set environment variables for storage and server port
24
  ENV STORAGE_DIR="/data/storage"
25
  ENV SERVER_PORT=7860
@@ -38,6 +40,4 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
38
 
39
  COPY --chown=user . /app
40
 
41
-
42
-
43
  ENTRYPOINT ["/entrypoint.sh"]
 
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
  FROM python:3.9
5
+
 
6
  # Switch to root user to perform administrative tasks
7
  USER root
8
 
 
19
  RUN useradd -m -u 1000 user \
20
  && chown -R user:user /data/storage
21
 
22
+ # Create /run/mysqld and set permissions AFTER user creation
23
+ RUN mkdir -p /run/mysqld && chown user:user /run/mysqld
24
+
25
  # Set environment variables for storage and server port
26
  ENV STORAGE_DIR="/data/storage"
27
  ENV SERVER_PORT=7860
 
40
 
41
  COPY --chown=user . /app
42
 
 
 
43
  ENTRYPOINT ["/entrypoint.sh"]