rallly/Dockerfile
Matthew Precious 8aa63acf93
Move prisma command to Dockerfile (#270)
This is required for a successful startup, so this makes it the
default command rather than requiring it to be overridden in the
compose file.

Co-authored-by: Luke Vella <me@lukevella.com>
2022-08-01 11:36:34 +01:00

27 lines
No EOL
386 B
Docker

FROM node:alpine as build
WORKDIR /app
COPY package.json .
COPY yarn.lock .
COPY prisma/schema.prisma .
RUN yarn --frozen-lockfile
COPY . .
RUN yarn build
FROM node:alpine
ENV PORT 3000
EXPOSE 3000
ARG DATABASE_URL
ENV DATABASE_URL $DATABASE_URL
WORKDIR /usr/src/app
COPY --from=build /app .
CMD sh -c "yarn prisma migrate deploy --schema prisma/schema.prisma && yarn start"