circulartext commited on
Commit
28175d8
·
1 Parent(s): 755d21d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -11
Dockerfile CHANGED
@@ -24,18 +24,17 @@ RUN chown -R user:user /app
24
  # Switch to the user for improved security
25
  USER user
26
 
27
- # Multi-stage build for installing gosu
28
- FROM alpine as gosu_installer
 
29
 
30
- # Install gosu in the alpine image
31
- RUN apk --no-cache add gosu
 
32
 
33
- # Final stage
34
- FROM base
35
 
36
- # Copy gosu from the gosu_installer image
37
- COPY --from=gosu_installer /usr/sbin/gosu /usr/sbin/gosu
38
 
39
- # Copy entrypoint.sh separately
40
- COPY entrypoint.sh /usr/local/bin/entrypoint.sh
41
- RUN chmod +x /usr/local/bin/entrypoint.sh
 
24
  # Switch to the user for improved security
25
  USER user
26
 
27
+ # Download and install gosu
28
+ RUN wget -O /usr/sbin/gosu "https://github.com/tianon/gosu/releases/download/1.14/gosu-amd64" \
29
+ && chmod +x /usr/sbin/gosu
30
 
31
+ # Set the entrypoint script as executable
32
+ COPY entrypoint.sh /usr/local/bin/entrypoint.sh
33
+ RUN chmod +x /usr/local/bin/entrypoint.sh
34
 
35
+ # Define the entrypoint script to handle user creation and application startup
36
+ ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
37
 
38
+ # Default command to run if the user doesn't provide a command
39
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
40