Spaces:
Sleeping
Sleeping
Commit ·
28175d8
1
Parent(s): 755d21d
Update Dockerfile
Browse files- 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 |
-
#
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
-
#
|
| 31 |
-
|
|
|
|
| 32 |
|
| 33 |
-
#
|
| 34 |
-
|
| 35 |
|
| 36 |
-
#
|
| 37 |
-
|
| 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 |
|
|
|
|
|
|
|
|
|