-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
53 lines (39 loc) · 1.35 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Use a Debian-based Node.js image as the base image
FROM node:20.9.0-buster-slim
# Set working directory
WORKDIR /app
# Set environment variables
ARG APP_SECRET
ENV APP_SECRET=${APP_SECRET}
ENV NODE_ENV=production
# Install the necessary build dependencies for git (required if npm package points to a git repo)
RUN apt-get update && \
apt-get install -y \
git
# Copy mantra-game directory to /app/mantra-game
COPY mantra-game /app/mantra-game
# Copy mantra-server directory (current path is now the root of the project)
COPY mantra-server /app/mantra-server
# Install dependencies for mantra-game
WORKDIR /app/mantra-game
RUN npm install
# Install dependencies for websocket server plugin
WORKDIR /app/mantra-game/plugins/server
RUN npm install
# Install dependencies for client plugin ( probably not needed )
WORKDIR /app/mantra-game/plugins/client
RUN npm install
# Install dependencies for matter.js plugin
WORKDIR /app/mantra-game/plugins/physics-matter
RUN npm install
# Install dependencies for mantra-server actual
WORKDIR /app/mantra-server
RUN npm install
# Copy mantra-client directory for static serving
COPY mantra-client /app/mantra-client
# Set work directory back to /app
WORKDIR /app
# Set a production port environment variable
ENV PRODUCTION_PORT=80
# Specify the command to run your application
CMD ["node", "./mantra-server/server.js"]