FROM node:20-alpine
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci
# Copy source code
COPY . .
# Build TypeScript code
RUN npm run build
# Set environment variables
ENV NODE_ENV=production
# Copy and make the entrypoint script executable
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
# Use the entrypoint script
ENTRYPOINT ["/docker-entrypoint.sh"]