tatasauce commited on
Commit
6721c0b
·
verified ·
1 Parent(s): 0bce889

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -1
Dockerfile CHANGED
@@ -1,7 +1,10 @@
 
1
  FROM yym68686/uni-api:latest
2
 
 
3
  RUN mkdir -p /data && chown -R 1000:1000 /data
4
 
 
5
  RUN useradd -m -u 1000 user
6
  USER user
7
 
@@ -9,13 +12,18 @@ ENV HOME=/home/user \
9
  PATH=/home/user/.local/bin:$PATH \
10
  DISABLE_DATABASE=true
11
 
 
12
  COPY --chown=user entrypoint.sh /home/user/entrypoint.sh
13
- RUN chmod +x /home/user/entrypoint.sh
14
 
 
15
  USER root
16
  RUN chmod 777 /home
 
 
17
  USER user
18
 
 
19
  WORKDIR /home/user
20
 
 
21
  ENTRYPOINT ["/home/user/entrypoint.sh"]
 
1
+ # Use the uni-api official image
2
  FROM yym68686/uni-api:latest
3
 
4
+ # Create data directory and set permissions
5
  RUN mkdir -p /data && chown -R 1000:1000 /data
6
 
7
+ # Set up user and working directory
8
  RUN useradd -m -u 1000 user
9
  USER user
10
 
 
12
  PATH=/home/user/.local/bin:$PATH \
13
  DISABLE_DATABASE=true
14
 
15
+ # Copy entrypoint script and ensure it has Unix line endings
16
  COPY --chown=user entrypoint.sh /home/user/entrypoint.sh
 
17
 
18
+ # Ensure /home directory is writable and fix script permissions
19
  USER root
20
  RUN chmod 777 /home
21
+ RUN chmod +x /home/user/entrypoint.sh
22
+ RUN sed -i 's/\r$//' /home/user/entrypoint.sh
23
  USER user
24
 
25
+ # Set working directory
26
  WORKDIR /home/user
27
 
28
+ # Entry point
29
  ENTRYPOINT ["/home/user/entrypoint.sh"]