Skip to content

Commit

Permalink
changed the app location in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kash2104 committed Nov 14, 2024
1 parent 6d995f2 commit 4bcbad0
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@ RUN corepack enable

COPY --chown=root:root --chmod=755 package.json turbo.json pnpm-*.yaml ./

RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --ignore-scripts --frozen-lockfile && \
rm -rf /root/.npm /root/.node-gyp /tmp/npm-*
COPY --chown=root:root --chmod=755 apps/api/package.json apps/api/tsconfig.json /app

COPY --chown=root:root --chmod=755 packages packages
COPY --chown=root:root --chmod=755 apps/api/package.json apps/api/tsconfig.json apps/api/

# Install dependencies using pnpm with cache mount
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
pnpm install --ignore-scripts --frozen-lockfile && \
rm -rf /root/.npm /root/.node-gyp /tmp/npm-*

COPY --chown=root:root --chmod=755 apps/api/src apps/api/src
COPY --chown=root:root --chmod=755 apps/api/src /app/src

RUN pnpm db:generate-types && \
pnpm build:api && \
pnpm sourcemaps:api
pnpm build:api && \
pnpm sourcemaps:api

# USER node

Expand All @@ -40,10 +41,10 @@ ENV NODE_ENV=production

WORKDIR /app

# COPY --chown=root:root --chmod=755 --from=build /app/node_modules /app/node_modules
COPY --chown=node:node --chmod=755 --from=build /app/apps/api/node_modules /app/apps/api/node_modules
COPY --chown=node:node --chmod=755 --from=build /app/apps/api/dist /app/apps/api/dist
COPY --chown=node:node --chmod=755 --from=build /app/node_modules /app/node_modules

COPY --chown=node:node --chmod=755 --from=build /app/dist /app/dist

EXPOSE ${API_PORT}

ENTRYPOINT ["node", "/app/apps/api/dist/main.js"]
ENTRYPOINT ["node", "/app/dist/main.js"]

0 comments on commit 4bcbad0

Please sign in to comment.