Skip to content

Commit

Permalink
Merge pull request #110 from jeiltodo/temp/common-client
Browse files Browse the repository at this point in the history
fix: standalone 적용
  • Loading branch information
Dragonite-Lee committed Aug 22, 2024
2 parents 796c816 + 254a3c2 commit b739c53
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions apps/admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN apk add --no-cache bash curl
RUN npm i -g npm
RUN corepack enable && corepack prepare yarn@stable --activate

COPY . .
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

FROM node:20-alpine AS builder
Expand All @@ -18,12 +18,12 @@ RUN yarn build --filter=admin
FROM node:20-alpine AS runner
WORKDIR /app

COPY --from=builder /app/apps/admin/.next ./.next
COPY --from=builder /app/apps/admin/.next/standalone ./
COPY --from=builder /app/apps/admin/.next/static ./.next/static
COPY --from=builder /app/apps/admin/public ./public
COPY --from=builder /app/apps/admin/package.json ./package.json
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/apps/admin/next.config.js ./next.config.js
COPY --from=builder /app/node_modules ./node_modules

ENV PORT=3001

EXPOSE 3001
CMD ["yarn", "start", "--port", "3001"]
CMD ["node", "server.js"]
1 change: 1 addition & 0 deletions apps/admin/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
module.exports = {
basePath: '/admin',
assetPrefix: '/admin/',
output: 'standalone',
reactStrictMode: true,
transpilePackages: ['@jeiltodo/ui'],
eslint: {
Expand Down
11 changes: 5 additions & 6 deletions apps/user/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ RUN apk add --no-cache bash curl
RUN npm i -g npm
RUN corepack enable && corepack prepare yarn@stable --activate

COPY . .
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

FROM node:20-alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules

RUN yarn build --filter=user

FROM node:20-alpine AS runner
WORKDIR /app

COPY --from=builder /app/apps/user/.next ./.next
COPY --from=builder /app/apps/user/.next/standalone ./
COPY --from=builder /app/apps/user/.next/static ./.next/static
COPY --from=builder /app/apps/user/public ./public
COPY --from=builder /app/apps/user/package.json ./package.json
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/node_modules ./node_modules

EXPOSE 3000
CMD ["yarn", "start"]
CMD ["node", "server.js"]
1 change: 1 addition & 0 deletions apps/user/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: 'standalone',
reactStrictMode: true,
transpilePackages: ['@jeiltodo/ui'],
eslint: {
Expand Down

0 comments on commit b739c53

Please sign in to comment.