-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Dockerfile and docker-compose.dev.yml files
- Loading branch information
1 parent
368e014
commit 8b19242
Showing
4 changed files
with
17 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,41 +1,22 @@ | ||
FROM node:20-alpine AS deps | ||
FROM node:18-alpine | ||
|
||
# RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn | ||
RUN mkdir -p /app | ||
|
||
FROM node:20-alpine AS builder | ||
WORKDIR /app | ||
COPY --from=deps /app/node_modules ./node_modules | ||
COPY . . | ||
|
||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
COPY package.json /app | ||
|
||
RUN yarn global add next react react-dom | ||
RUN npm install -g next | ||
|
||
RUN yarn build | ||
|
||
FROM node:20-alpine AS runner | ||
WORKDIR /app | ||
RUN npm install | ||
|
||
ENV NODE_ENV production | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
COPY . /app | ||
|
||
RUN yarn global add next react react-dom | ||
RUN mkdir -p /app/.next/cache/images | ||
VOLUME /app/.next/cache/images | ||
|
||
RUN addgroup --system --gid 1001 nodejs | ||
RUN adduser --system --uid 1001 nextjs | ||
|
||
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./package.json | ||
|
||
USER nextjs | ||
RUN npm run build | ||
|
||
EXPOSE 3000 | ||
|
||
ENV PORT 3000 | ||
|
||
CMD ["yarn", "start"] | ||
CMD npm run start |
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,14 +1,12 @@ | ||
version: '3.8' | ||
version: "3.8" | ||
services: | ||
web: | ||
biogpt: | ||
build: | ||
context: . | ||
dockerfile: dev.Dockerfile | ||
# target: runner | ||
dockerfile: Dockerfile | ||
restart: always | ||
volumes: | ||
- .:/app | ||
command: yarn start | ||
- /app/node_modules | ||
- /app/.next | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
NODE_ENV: development | ||
- "3000:3000" |
This file was deleted.
Oops, something went wrong.