-
Notifications
You must be signed in to change notification settings - Fork 46
/
Dockerfile
40 lines (31 loc) · 804 Bytes
/
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
# Use an official Node.js runtime as the base image
FROM node:18-bullseye
# Set the TERM environment variable to xterm
ENV TERM xterm
# Install required packages
RUN apt-get update && apt-get install -y \
libgtk2.0-0 \
libgtk-3-0 \
libgbm-dev \
libnotify-dev \
libgconf-2-4 \
libnss3 \
libxss1 \
libasound2 \
libxtst6 \
xauth \
xvfb \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the container
COPY . .
# Install project dependencies
RUN npm install
ARG BUILD_COMMAND=build
# Build the React app
RUN npm run ${BUILD_COMMAND}
# Expose a port (e.g., 3000) for your React app to run
EXPOSE 3000
# Serve the built React app
CMD [ "npx", "serve", "-s", "build" ]