Update Dockerfile
Browse files- Dockerfile +13 -3
Dockerfile
CHANGED
@@ -4,13 +4,23 @@ FROM node:20.4
|
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /app
|
6 |
|
|
|
7 |
RUN --mount=type=secret,id=CLONE,mode=0444,required=true \
|
8 |
git clone https://github.com/tutoihoc/SillyTavern.git .
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
chmod -R
|
|
|
|
|
|
|
|
|
|
|
13 |
RUN npm install
|
14 |
|
|
|
|
|
|
|
|
|
15 |
# Start the application
|
16 |
CMD ["node", "server.js"]
|
|
|
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://github.com/tutoihoc/SillyTavern.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 |
+
# Create webpack directory with correct permissions
|
22 |
+
RUN mkdir -p /app/dist/webpack && \
|
23 |
+
chmod -R 755 /app/dist
|
24 |
+
|
25 |
# Start the application
|
26 |
CMD ["node", "server.js"]
|