FROM node:20-alpine

WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install --omit=dev

COPY src ./src
COPY migrations ./migrations

ENV PORT=3000
CMD ["sh", "-c", "node src/migrate.js && node src/server.js"]
