Jofthomas commited on
Commit
3911b56
·
verified ·
1 Parent(s): 158f500

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -6
Dockerfile CHANGED
@@ -1,19 +1,32 @@
1
  FROM node:18
2
 
3
- # Create an app directory
4
  WORKDIR /app
5
 
6
- # Clone Showdown source
7
  RUN git clone https://github.com/smogon/pokemon-showdown.git .
8
 
 
 
 
 
 
 
 
 
 
9
  # Install dependencies
10
- RUN npm install --legacy-peer-deps
11
 
12
- # Copy the example config so the server starts (you can edit if needed)
13
  RUN cp config/config-example.js config/config.js
14
 
15
- # Expose the desired port (e.g. 8000)
16
  EXPOSE 8000
17
 
18
- # Run the server when the container starts
 
 
 
 
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"]