Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Stage 1: Clone & install
|
| 2 |
+
FROM node:20-alpine AS builder
|
| 3 |
+
|
| 4 |
+
# Install git for cloning
|
| 5 |
+
RUN apk add --no-cache git
|
| 6 |
+
|
| 7 |
+
WORKDIR /app
|
| 8 |
+
|
| 9 |
+
# Clone only the latest commit (shallow) and remove .git to keep it small
|
| 10 |
+
RUN git clone --depth 1 https://github.com/theonlymo/SRTtoVTT.git . \
|
| 11 |
+
&& rm -rf .git
|
| 12 |
+
|
| 13 |
+
# Install production dependencies
|
| 14 |
+
RUN npm ci --only=production
|
| 15 |
+
|
| 16 |
+
# Stage 2: Runtime
|
| 17 |
+
FROM node:20-alpine
|
| 18 |
+
|
| 19 |
+
WORKDIR /app
|
| 20 |
+
|
| 21 |
+
# Copy over installed deps and app code from builder
|
| 22 |
+
COPY --from=builder /app /app
|
| 23 |
+
|
| 24 |
+
# Expose the port the app listens on
|
| 25 |
+
EXPOSE 5000
|
| 26 |
+
|
| 27 |
+
# Start the server
|
| 28 |
+
CMD ["npm", "start"]
|