28 lines
566 B
Docker
28 lines
566 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
FROM node:22-alpine AS builder
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
|
|
ENV DATABASE_URL=postgres://build:build@localhost:5432/build \
|
|
BETTER_AUTH_SECRET=build-time-placeholder \
|
|
BETTER_AUTH_URL=http://localhost:3000
|
|
|
|
RUN npm run build
|
|
|
|
FROM node:22-alpine AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
|
|
COPY --from=builder /app ./
|
|
|
|
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
EXPOSE 3000
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"] |