forked from itswadesh/svelte-commerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (25 loc) · 796 Bytes
/
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
##### Stage 1 - Development - Generate dist folder
FROM node:16 AS builder
LABEL author="Swadesh Behera"
RUN npm install -g pnpm
# Add timezone
RUN apt-get install -yq tzdata && \
ln -fs /usr/share/zoneinfo/Asia/Kolkata /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
WORKDIR /usr/app
COPY package.json ./
COPY .npmrc ./
ENV PUPPETEER_SKIP_DOWNLOAD="true"
RUN pnpm install --force
RUN cp -R node_modules prod_node_modules
COPY . .
RUN pnpm run build
##### Stage 2 - Production
FROM builder as production
WORKDIR /usr/app
COPY --from=builder /usr/app/prod_node_modules ./node_modules
COPY --from=builder /usr/app/package*.json ./
ENV PUPPETEER_SKIP_DOWNLOAD="true"
ENV NODE_ENV=production
COPY --from=builder /usr/app/.svelte-kit ./.svelte-kit
CMD [ "pnpm", "start" ]