- Agregar ARG en client/Dockerfile para NEXT_PUBLIC_API_URL - Pasar build args en docker-compose.yml - Asegurar que Next.js reciba la URL correcta del servidor - Permitir acceso desde 192.168.1.131
27 lines
445 B
Docker
27 lines
445 B
Docker
FROM node:20-alpine
|
|
|
|
# Build argument for API URL
|
|
ARG NEXT_PUBLIC_API_URL=http://localhost:4000
|
|
|
|
# Create app directory
|
|
WORKDIR /app
|
|
|
|
# Copy shared module first (as a sibling to client)
|
|
COPY shared ./shared
|
|
|
|
# Setup Client directory
|
|
WORKDIR /app/client
|
|
|
|
# Install dependencies
|
|
COPY client/package*.json ./
|
|
RUN npm install
|
|
|
|
# Copy client source code
|
|
COPY client/ .
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Run Next.js in dev mode
|
|
CMD ["npx", "next", "dev"]
|