Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +25 -0
Dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 1. Use Alpine Linux for a minimal builder image
|
| 2 |
+
FROM alpine AS builder
|
| 3 |
+
|
| 4 |
+
# 2. Install Node.js, npm, and git
|
| 5 |
+
RUN apk add --no-cache nodejs npm git
|
| 6 |
+
|
| 7 |
+
# 3. Create a non-root user for safety
|
| 8 |
+
RUN adduser -D app
|
| 9 |
+
USER app
|
| 10 |
+
|
| 11 |
+
# 4. Set working directory
|
| 12 |
+
WORKDIR /home/app
|
| 13 |
+
|
| 14 |
+
# 5. Clone Uptime Kuma repository
|
| 15 |
+
RUN git clone https://github.com/louislam/uptime-kuma.git
|
| 16 |
+
|
| 17 |
+
# 6. Install and build Uptime Kuma
|
| 18 |
+
WORKDIR /home/app/uptime-kuma
|
| 19 |
+
RUN npm run setup
|
| 20 |
+
|
| 21 |
+
# 7. Expose the port (must match app_port above)
|
| 22 |
+
EXPOSE 3001
|
| 23 |
+
|
| 24 |
+
# 8. Start the Uptime Kuma server
|
| 25 |
+
CMD ["node", "server/server.js"]
|