Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +19 -6
Dockerfile
CHANGED
@@ -1,19 +1,32 @@
|
|
1 |
FROM node:18
|
2 |
|
3 |
-
# Create
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
# Clone Showdown
|
7 |
RUN git clone https://github.com/smogon/pokemon-showdown.git .
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# Install dependencies
|
10 |
-
RUN npm install
|
11 |
|
12 |
-
# Copy
|
13 |
RUN cp config/config-example.js config/config.js
|
14 |
|
15 |
-
# Expose
|
16 |
EXPOSE 8000
|
17 |
|
18 |
-
#
|
|
|
|
|
|
|
|
|
19 |
CMD ["node", "pokemon-showdown", "8000"]
|
|
|
1 |
FROM node:18
|
2 |
|
3 |
+
# Create working directory
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
# Clone Showdown
|
7 |
RUN git clone https://github.com/smogon/pokemon-showdown.git .
|
8 |
|
9 |
+
# Switch to the Showdown folder
|
10 |
+
WORKDIR /app/pokemon-showdown
|
11 |
+
|
12 |
+
# Give write permissions to the entire folder (quick fix)
|
13 |
+
RUN chmod -R 777 /app/pokemon-showdown
|
14 |
+
|
15 |
+
# Or, more correct: chown everything to node
|
16 |
+
# RUN chown -R node:node /app/pokemon-showdown
|
17 |
+
|
18 |
# Install dependencies
|
19 |
+
RUN npm install
|
20 |
|
21 |
+
# Copy default config
|
22 |
RUN cp config/config-example.js config/config.js
|
23 |
|
24 |
+
# Expose a port
|
25 |
EXPOSE 8000
|
26 |
|
27 |
+
# Use root or node user
|
28 |
+
# If you prefer the node user for security, do:
|
29 |
+
# USER node
|
30 |
+
|
31 |
+
# Finally, start server
|
32 |
CMD ["node", "pokemon-showdown", "8000"]
|