This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (39 loc) · 1.46 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM node:18-alpine AS base
RUN npm install -g pm2
RUN npm install -g [email protected]
ARG ILLA_CLOUD_URL
ENV ILLA_CLOUD_URL=$ILLA_CLOUD_URL
ARG ILLA_MARKET_URL
ENV ILLA_MARKET_URL=$ILLA_MARKET_URL
ARG ILLA_API_BASE_URL
ENV ILLA_API_BASE_URL=$ILLA_API_BASE_URL
ARG ILLA_APP_ENV
ENV ILLA_APP_ENV=$ILLA_APP_ENV
# This Dockerfile is copy-pasted into our main docs at /docs/handbook/deploying-with-docker.
# Make sure you update both files!
FROM base AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk update
# Set working directory
WORKDIR /app
COPY . .
RUN pnpm install --frozen-lockfile
RUN pnpm turbo run build --filter=illa-market-fe
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
COPY --from=builder /app/app/next.config.js .
COPY --from=builder /app/app/package.json .
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/app/.next/static ./app/.next/static
COPY --from=builder --chown=nextjs:nodejs /app/app/public ./app/public
EXPOSE 3000
ENV PORT 3000
# CMD pnpm turbo run start --filter=tipis-market-fe
CMD node app/server.js