FROM node:18-alpine
# Create app directory
WORKDIR /usr/src/app
# Install dependencies
COPY package*.json ./
RUN npm ci --only=production
# Bundle app source
COPY . .
# Build the TypeScript code
RUN npm run build
# Create log directory
RUN mkdir -p logs
# Expose the port the app runs on
EXPOSE 3000
# Start the server
CMD [ "node", "dist/index.js" ]