forked from danny-avila/LibreChat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-app
35 lines (25 loc) · 904 Bytes
/
Dockerfile-app
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
# ./Dockerfile
FROM node:19-alpine
WORKDIR /app
# Copy package.json files for client and api
COPY /client/package*.json /app/client/
COPY /api/package*.json /app/api/
# Install dependencies for both client and api
RUN cd /app/client && npm ci
RUN cd /app/api && npm ci
# Copy the current directory contents into the container
COPY /client/ /app/client/
COPY /api/ /app/api/
# Set the memory limit for Node.js
ENV NODE_OPTIONS="--max-old-space-size=2048"
# Build webpack artifacts for the client
RUN cd /app/client && npm run build
# Create the necessary directory and copy the client side code to the api directory
RUN mkdir -p /app/api/client && cp -R /app/client/dist /app/api/client/dist
# Make port 3080 available to the world outside this container
EXPOSE 3080
# Expose the server to 0.0.0.0
ENV HOST=0.0.0.0
# Run the app when the container launches
WORKDIR /app/api
CMD ["npm", "start"]