-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite dockerfile to place node_modules one directory above volume dir
- Loading branch information
1 parent
8c6c25f
commit 39ac11e
Showing
5 changed files
with
40 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
FROM node:18 as deps | ||
FROM node:18-alpine as deps | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock | ||
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/* | ||
|
||
RUN yarn install --frozen-lockfile | ||
COPY package.json ./ | ||
|
||
RUN yarn install | ||
|
||
FROM node:18 as dev | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=deps /app/node_modules ./node_modules/ | ||
|
||
ENV PATH=/app/node_modules/.bin:$PATH | ||
|
||
WORKDIR /app/src | ||
|
||
COPY . . | ||
|
||
EXPOSE 3000 | ||
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
FROM node:18 as deps | ||
FROM node:18-alpine as deps | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock | ||
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/* | ||
|
||
RUN yarn install --frozen-lockfile | ||
COPY package.json ./ | ||
|
||
RUN yarn install | ||
|
||
FROM node:18 as dev | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=deps /app/node_modules ./node_modules/ | ||
|
||
ENV PATH=/app/node_modules/.bin:$PATH | ||
|
||
WORKDIR /app/src | ||
|
||
COPY . . | ||
|
||
EXPOSE 50052 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
**/node_modules | ||
!prisma/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
FROM node:18 as deps | ||
FROM node:18-alpine as deps | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock | ||
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/* | ||
|
||
RUN yarn install --frozen-lockfile | ||
RUN yarn global add node-gyp prisma | ||
|
||
COPY package.json ./ | ||
|
||
RUN mkdir prisma | ||
|
||
RUN yarn install | ||
|
||
FROM node:18 as dev | ||
|
||
RUN yarn global add nest prisma | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=deps /app/node_modules ./node_modules/ | ||
|
||
ENV PATH=/app/node_modules/.bin:$PATH | ||
|
||
COPY ./prisma/ ./prisma/ | ||
|
||
RUN prisma generate | ||
|
||
WORKDIR /app/src | ||
|
||
COPY . . | ||
|
||
EXPOSE 50053 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
#!/bin/bash | ||
|
||
yarn prisma migrate deploy | ||
|
||
yarn prisma generate | ||
prisma migrate dev | ||
|
||
yarn start:dev |