Jofthomas commited on
Commit
11b3474
·
verified ·
1 Parent(s): 8b62f80

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -13
Dockerfile CHANGED
@@ -1,26 +1,30 @@
1
- FROM ubuntu:22.04 as base
2
- WORKDIR /app
3
- ENV NODE_ENV=production
4
-
5
- FROM base as build
6
 
 
7
  RUN apt-get update -qq && \
8
- apt-get install -y git curl unzip wget gnupg build-essential lsb-release
 
9
 
 
10
  RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
11
  apt-get install -y nodejs
12
 
 
13
  RUN useradd -m -u 1000 user
14
- RUN chown -R user:user /app /usr/local /tmp
15
  USER user
16
- ENV HOME=/home/user \
17
- PATH=/home/user/.local/bin:$PATH
18
 
19
- WORKDIR $HOME/app
 
20
 
21
- # Default port for Pokemon Showdown
22
- EXPOSE 8000
23
 
 
 
 
24
 
 
 
25
 
26
- ENTRYPOINT ["/bin/sh", "-c", "node pokemon-showdown"]
 
 
1
+ FROM ubuntu:22.04
 
 
 
 
2
 
3
+ # Install prerequisites
4
  RUN apt-get update -qq && \
5
+ apt-get install -y git curl unzip wget gnupg build-essential && \
6
+ rm -rf /var/lib/apt/lists/*
7
 
8
+ # Install Node.js 18
9
  RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
10
  apt-get install -y nodejs
11
 
12
+ # Create user
13
  RUN useradd -m -u 1000 user
 
14
  USER user
 
 
15
 
16
+ # Set working directory to the user's home
17
+ WORKDIR /home/user
18
 
19
+ # Clone Pokémon Showdown
20
+ RUN git clone https://github.com/smogon/pokemon-showdown.git
21
 
22
+ # Change to the cloned directory and install deps
23
+ WORKDIR /home/user/pokemon-showdown
24
+ RUN npm install --production
25
 
26
+ # Expose default Showdown port
27
+ EXPOSE 8000
28
 
29
+ # Run the server
30
+ CMD ["node", "pokemon-showdown"]