Jofthomas commited on
Commit
0a1b870
·
verified ·
1 Parent(s): a3ed71e

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Base image: Node 16 (LTS)
2
+ FROM node:16
3
+
4
+ # Create an app directory inside the container
5
+ WORKDIR /app
6
+
7
+ # (Option A) Clone the official Pokémon Showdown repo
8
+ # RUN git clone https://github.com/smogon/pokemon-showdown.git .
9
+
10
+ # (Option B) If you have a custom fork, clone it
11
+ RUN git clone https://github.com/smogon/pokemon-showdown.git .
12
+
13
+ # Copy config-example.js -> config.js so we have a default config
14
+ RUN cp config/config-example.js config/config.js
15
+
16
+ # Install dependencies
17
+ RUN npm install --legacy-peer-deps
18
+
19
+ # Some optional housekeeping: remove unnecessary dev deps, etc.
20
+ # Not strictly required. But if you do have devDependencies, you can prune them:
21
+ # RUN npm prune --production
22
+
23
+ # Expose the correct port (Hugging Face Spaces dynamically sets the environment variable PORT)
24
+ EXPOSE 7860
25
+
26
+ # Start the server
27
+ # We need to pass the environment variable $PORT to Pokémon Showdown; the easiest is
28
+ # to do this with a small shell invocation so $PORT is expanded.
29
+ CMD ["bash", "-c", "node pokemon-showdown $PORT"]