Jofthomas commited on
Commit
8ba2eb6
·
verified ·
1 Parent(s): 21e5fe9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -10
Dockerfile CHANGED
@@ -1,17 +1,25 @@
1
- FROM node:18
2
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
- # Clone into the subfolder explicitly
6
- RUN git clone https://github.com/smogon/pokemon-showdown.git /app/pokemon-showdown
7
 
8
- WORKDIR /app/pokemon-showdown
 
9
 
10
- # Optional: fix permissions so Showdown can write to dist/
11
- RUN chmod -R 777 /app/pokemon-showdown
12
 
13
- RUN npm install
14
- RUN cp config/config-example.js config/config.js
15
 
16
- EXPOSE 8000
17
- CMD ["node", "pokemon-showdown", "8000"]
 
1
+ # Starting Image
2
 
3
+ # Node Ver.18 Alpine
4
+ FROM node:18-alpine
5
+
6
+ # Default PS! Server Port
7
+ EXPOSE 8000
8
+
9
+ # Container Entrypoint
10
  WORKDIR /app
11
 
12
+ # Install Git Package
13
+ RUN ["apk", "add", "git"]
14
 
15
+ # Create a git repository
16
+ RUN ["git", "init", "."]
17
 
18
+ # Set the remote repository to the showdown repository
19
+ RUN ["git", "remote", "add", "origin", "https://www.github.com/smogon/pokemon-showdown.git"]
20
 
21
+ # (Entry Point) Update the server repository and start the server
22
+ ENTRYPOINT ["git" "pull" "origin" "master" "&&" "node", "pokemon-showdown"]
23
 
24
+ # Specify the -c switch on exec
25
+ CMD ["-c"]