Jofthomas commited on
Commit
2233477
·
verified ·
1 Parent(s): 356d497

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -12
Dockerfile CHANGED
@@ -1,20 +1,25 @@
1
- # Start from Node.js 18 Alpine
 
 
2
  FROM node:18-alpine
3
 
4
- # Default port for Pokemon Showdown
5
  EXPOSE 8000
6
 
7
- # Set up working directory
8
  WORKDIR /app
9
 
10
- # Install Git
11
- RUN apk add --no-cache git
 
 
 
 
 
 
12
 
13
- # Initialize git repository and set remote
14
- RUN git init .
15
- RUN git remote add origin https://www.github.com/smogon/pokemon-showdown.git
16
 
17
- # Use a shell entrypoint to chain multiple commands:
18
- # 1) Pull latest code
19
- # 2) Launch showdown server
20
- ENTRYPOINT ["/bin/sh", "-c", "git pull origin master && node pokemon-showdown"]
 
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"]