mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00

- Remove api/.env and .env from .dockerignore file - Add COPY .env .env to Dockerfile to copy .env file to docker build - Add RUN rm .env to Dockerfile to remove .env file after build - Remove build args from docker-compose.yml file
27 lines
622 B
Docker
27 lines
622 B
Docker
# Base node image
|
|
FROM node:19-alpine AS node
|
|
COPY . /app
|
|
# Copy .env file
|
|
COPY .env .env
|
|
# Install dependencies
|
|
WORKDIR /app
|
|
RUN npm ci
|
|
|
|
# React client build
|
|
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
|
RUN npm run frontend
|
|
|
|
# Remove .env file after build
|
|
RUN rm .env
|
|
|
|
# Node API setup
|
|
EXPOSE 3080
|
|
ENV HOST=0.0.0.0
|
|
CMD ["npm", "run", "backend"]
|
|
|
|
# Optional: for client with nginx routing
|
|
# FROM nginx:stable-alpine AS nginx-client
|
|
# WORKDIR /usr/share/nginx/html
|
|
# COPY --from=node /app/client/dist /usr/share/nginx/html
|
|
# COPY client/nginx.conf /etc/nginx/conf.d/default.conf
|
|
# ENTRYPOINT ["nginx", "-g", "daemon off;"]
|