-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.api
47 lines (36 loc) · 1.2 KB
/
Dockerfile.api
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
FROM node:16-alpine
# ENV ARGS
ARG SUPABASE_URL
ARG SUPABASE_SERVICE_ROLE_KEY
ARG SUPABASE_ANON_KEY
ARG STRIPE_PUBLIC_KEY
ARG STRIPE_SECRET_KEY
ARG STRIPE_WEBHOOK_SECRET
ARG STRIPE_SUBSCRIPTION_ID
ARG PAYMENT_REDIRECT_HOST
# With default values
ENV PORT=80
ENV SUPABASE_URL=$SUPABASE_URL
ENV SUPABASE_SERVICE_ROLE_KEY=$SUPABASE_SERVICE_ROLE_KEY
ENV SUPABASE_ANON_KEY=$SUPABASE_ANON_KEY
ENV STRIPE_PUBLIC_KEY=$STRIPE_PUBLIC_KEY
ENV STRIPE_SECRET_KEY=$STRIPE_SECRET_KEY
ENV STRIPE_WEBHOOK_SECRET=$STRIPE_WEBHOOK_SECRET
ENV STRIPE_SUBSCRIPTION_ID=$STRIPE_SUBSCRIPTION_ID
ENV PAYMENT_REDIRECT_HOST=$PAYMENT_REDIRECT_HOST
# should be specified
WORKDIR /webapp
RUN apk add --update curl && rm -rf /var/cache/apk/*
RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
COPY ./package.json ./
COPY ./pnpm-lock.yaml ./
COPY ./pnpm-workspace.yaml ./
COPY ./tsconfig.json ./
COPY ./shared ./shared
COPY ./back ./back
RUN pnpm install --frozen-lockfile --prefix shared --shamefully-hoist \
&& pnpm --prefix shared run build
RUN pnpm install --frozen-lockfile --prefix back --shamefully-hoist \
&& pnpm --prefix back run build
ENV NODE_ENV=production
CMD [ "pnpm", "run", "--prefix", "back", "start" ]