Skip to content

Commit

Permalink
fix: container restarting
Browse files Browse the repository at this point in the history
  • Loading branch information
aatalrashid committed Jan 10, 2024
1 parent 875d9cc commit a483d50
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions infra/docker/Dockerfile.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ RUN apk add --no-cache libc6-compat
RUN apk update
WORKDIR /app

# Install the dependencies
# First install dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
RUN yarn install --network-timeout 100000

# Build the project
# Build the project and its dependencies
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json

# Remote caching
# Uncomment and use build args to enable remote caching
# ARG TURBO_TEAM
# ENV TURBO_TEAM=$TURBO_TEAM

Expand All @@ -40,16 +40,9 @@ FROM base AS runner
WORKDIR /app

# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs
RUN addgroup --system --gid 1001 expressjs
RUN adduser --system --uid 1001 expressjs
USER expressjs
COPY --from=installer /app .

#COPY --from=installer /app/apps/api/next.config.js .
COPY --from=installer /app/apps/api/package.json .

# Reduce image size
#COPY --from=installer --chown=nextjs:nodejs /app/apps/api/.next/standalone ./
#COPY --from=installer --chown=nextjs:nodejs /app/apps/api/.next/static ./apps/api/.next/static
#COPY --from=installer --chown=nextjs:nodejs /app/apps/api/public ./apps/api/public

CMD node apps/api/server.js
CMD node apps/api/dist/index.js

0 comments on commit a483d50

Please sign in to comment.