Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Node.js image as the base image
|
| 2 |
+
FROM node:20.4
|
| 3 |
+
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Clone repository with secret mount
|
| 8 |
+
RUN --mount=type=secret,id=CLONE,mode=0444,required=true \
|
| 9 |
+
git clone https://$(cat /run/secrets/CLONE)@github.com/locmaymo/status-page.git .
|
| 10 |
+
|
| 11 |
+
# Change ownership and permissions
|
| 12 |
+
RUN chown -R node:node /app && \
|
| 13 |
+
chmod -R 755 /app
|
| 14 |
+
|
| 15 |
+
# Switch to non-root user
|
| 16 |
+
USER node
|
| 17 |
+
|
| 18 |
+
# Install dependencies
|
| 19 |
+
RUN npm install
|
| 20 |
+
|
| 21 |
+
# Start the application
|
| 22 |
+
CMD ["npm", "start"]
|