zyxciss commited on
Commit
b960254
·
verified ·
1 Parent(s): 5067a19

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -8
Dockerfile CHANGED
@@ -1,19 +1,21 @@
1
- # Use the prebuilt image as the base
2
  FROM ghcr.io/remsky/kokoro-fastapi-cpu:v0.2.0post3
3
 
4
- # Install socat (if not already available)
5
- # For Debian/Ubuntu–based images:
 
6
  RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/*
7
 
8
- # Set a default PORT in case Spaces doesn’t inject one (Spaces usually will)
9
- ENV PORT=8880
 
10
 
11
- # Expose the port that Spaces will use
 
12
  EXPOSE ${PORT}
13
 
14
- # Copy in a startup script
15
  COPY start.sh /start.sh
16
  RUN chmod +x /start.sh
17
 
18
- # Use our startup script as the container’s command
19
  CMD ["/start.sh"]
 
 
1
  FROM ghcr.io/remsky/kokoro-fastapi-cpu:v0.2.0post3
2
 
3
+ # Switch to root so we can install packages
4
+ USER root
5
+
6
  RUN apt-get update && apt-get install -y socat && rm -rf /var/lib/apt/lists/*
7
 
8
+ # Optionally, switch back to the original non-root user if needed.
9
+ # Replace "appuser" with the appropriate username if known.
10
+ # USER appuser
11
 
12
+ # Set environment variables and expose the port
13
+ ENV PORT=8880
14
  EXPOSE ${PORT}
15
 
16
+ # Copy the startup script that forwards the dynamic port to port 8880
17
  COPY start.sh /start.sh
18
  RUN chmod +x /start.sh
19
 
20
+ # Start the wrapper script
21
  CMD ["/start.sh"]