Spaces:
Paused
Paused
Upload 2 files
Browse files- Dockerfile +28 -0
- start.sh +2 -0
Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Base image
|
| 2 |
+
FROM quay.io/suhailtechinfo/suhail-v2
|
| 3 |
+
|
| 4 |
+
# Create the app directory with correct permissions
|
| 5 |
+
RUN mkdir -p /home/app && chown -R node:node /home/app
|
| 6 |
+
|
| 7 |
+
# Set the working directory
|
| 8 |
+
WORKDIR /home/app
|
| 9 |
+
|
| 10 |
+
# Copy the entire app directory into the container with the correct ownership
|
| 11 |
+
COPY --chown=node:node . .
|
| 12 |
+
|
| 13 |
+
# Install dependencies
|
| 14 |
+
RUN npm install || yarn install
|
| 15 |
+
|
| 16 |
+
# Create the start.sh script with the correct permissions
|
| 17 |
+
RUN echo '#!/bin/sh\nnpm start' > start.sh \
|
| 18 |
+
&& chmod +x start.sh \
|
| 19 |
+
&& chown node:node start.sh
|
| 20 |
+
|
| 21 |
+
# Switch to the 'node' user
|
| 22 |
+
USER node
|
| 23 |
+
|
| 24 |
+
# Expose the port
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# Run the start.sh script
|
| 28 |
+
CMD ["sh", "start.sh"]
|
start.sh
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
npm start
|