# Base image
FROM node:20.11.0

# Create app directory
WORKDIR /usr/src/app

# Copia el archivo .env.example y renómbralo a .env
COPY .env.example .env

# Copy package.json, pnpm-lock.yaml and pnpm-workspace.yaml
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./

# Install pnpm and app dependencies
RUN corepack enable && corepack prepare pnpm@11.13.0 --activate
RUN pnpm install --frozen-lockfile

# Bundle app source
COPY . .

# Expose the port on which the app will run
EXPOSE 5600

# Start the server
CMD ["node", "src/server.js"]
# Start the server using the production build