-
Notifications
You must be signed in to change notification settings - Fork 77
/
Dockerfile.dev
37 lines (25 loc) · 768 Bytes
/
Dockerfile.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# pick image with git and bash
# ARG BASE=mcr.microsoft.com/vscode/devcontainers/javascript-node:0-16-bullseye
ARG BASE=node:16-bullseye
# no ENV vars required buildtime
#---------------------
FROM ${BASE} AS dependencies
WORKDIR /app
ENV NODE_ENV development
COPY package.json yarn.lock ./
COPY prisma ./prisma
RUN yarn install
RUN npx prisma generate
RUN rm -rf prisma
# don't copy source, mount it via volume
# volumes folders must be created and chowned before docker-compose creates them as root
# create them during docker build
RUN mkdir -p .next
RUN chown node:node . node_modules .next
RUN chown -R node:node node_modules/.prisma
USER node
# debug
# RUN ls -la node_modules/.prisma/client
EXPOSE 3001
ENV PORT 3001
CMD [ "yarn", "cmd:start:dev" ]