forked from Sanjeet990/Astroluma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (30 loc) · 1.02 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
# Use the official Node.js image as the base image
FROM node:18
# Set the working directory in the container
WORKDIR /app
# Copy the server and client folders from the host to the working directory in the container
COPY server /app/server
COPY client /app/client
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies for both server and client
RUN npm install
# Set working directory to client
WORKDIR /app/client
# Build the React client
RUN chown root.root . # make sure root own the directory before installing Sharp
RUN npm run build
# Copy the dist directory to the server/dist
RUN cp -r /app/client/dist /app/server/dist
# Remove the client folder
RUN rm -rf /app/client
# Reset working directory to app root
WORKDIR /app
# Install ffmpeg and ping
RUN apt-get update && apt-get install -y ffmpeg iputils-ping arp-scan
# Setup
RUN npm run setup
# Expose the port on which your Node.js app will run
EXPOSE 8000
# Start the Node.js app
CMD ["npm", "run", "server"]