Update Dockerfile
Browse files- Dockerfile +14 -8
Dockerfile
CHANGED
@@ -1,17 +1,23 @@
|
|
1 |
-
# Use official Bun image
|
2 |
FROM oven/bun:1.0.30
|
3 |
|
|
|
|
|
|
|
|
|
|
|
4 |
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Copy
|
8 |
-
COPY . .
|
9 |
-
|
10 |
-
# Install dependencies using Bun
|
11 |
RUN bun install
|
12 |
|
13 |
-
#
|
14 |
-
|
|
|
|
|
|
|
15 |
|
16 |
-
#
|
17 |
CMD ["bun", "./src/index.ts"]
|
|
|
1 |
+
# Use official Bun base image
|
2 |
FROM oven/bun:1.0.30
|
3 |
|
4 |
+
# Create non-root user like Hugging Face expects
|
5 |
+
RUN adduser --disabled-password --gecos "" user
|
6 |
+
USER user
|
7 |
+
ENV PATH="/home/user/.bun/bin:$PATH"
|
8 |
+
|
9 |
# Set working directory
|
10 |
WORKDIR /app
|
11 |
|
12 |
+
# Copy only dependencies first for caching
|
13 |
+
COPY --chown=user bun.lockb bunfig.toml ./
|
|
|
|
|
14 |
RUN bun install
|
15 |
|
16 |
+
# Copy the rest of the code
|
17 |
+
COPY --chown=user . .
|
18 |
+
|
19 |
+
# Port Hugging Face expects
|
20 |
+
EXPOSE 7860
|
21 |
|
22 |
+
# Run the server (make sure your script listens on port 7860)
|
23 |
CMD ["bun", "./src/index.ts"]
|