first commit
This commit is contained in:
parent
5c5d88c92f
commit
eb4f62c56d
41 changed files with 3851 additions and 19 deletions
37
docker_svc/real-time-chat-app/Dockerfile
Normal file
37
docker_svc/real-time-chat-app/Dockerfile
Normal file
|
@ -0,0 +1,37 @@
|
|||
# Use the official Node.js image as a base
|
||||
FROM node:20
|
||||
|
||||
# Set the working directory inside the container
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm globally with setup
|
||||
ENV PNPM_HOME=/usr/local/bin
|
||||
RUN npm install -g pnpm
|
||||
|
||||
# Copy package.json and package-lock.json to the working directory
|
||||
COPY app/package*.json ./
|
||||
|
||||
# Install dependencies using pnpm
|
||||
RUN pnpm install
|
||||
|
||||
# Set environment variables for the build
|
||||
ARG REACT_APP_API_BASE_URL
|
||||
ENV REACT_APP_API_BASE_URL=${REACT_APP_API_BASE_URL:-http://rag-service:8000}
|
||||
|
||||
# Copy specific folders to avoid node_modules
|
||||
COPY app/public ./public
|
||||
COPY app/src ./src
|
||||
COPY app/*.json ./
|
||||
|
||||
# Build the React application with pnpm - show env vars for debugging
|
||||
RUN echo "Building with API URL: $REACT_APP_API_BASE_URL" && \
|
||||
pnpm run build
|
||||
|
||||
# Use npm for global installs (more reliable in Docker)
|
||||
RUN npm install -g serve
|
||||
|
||||
# Expose the port the app runs on
|
||||
EXPOSE 3000
|
||||
|
||||
# Command to run the application
|
||||
CMD ["serve", "-s", "build"]
|
Loading…
Add table
Add a link
Reference in a new issue