forked from MarioTiscareno/sveltekit-personal-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (29 loc) · 714 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
29
30
31
32
33
34
35
36
37
38
FROM node:21-alpine AS builder
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
ARG SENDGRID_API_KEY
ENV SENDGRID_API_KEY=$SENDGRID_API_KEY
ARG SENDGRID_SENDER
ENV SENDGRID_SENDER=$SENDGRID_SENDER
ARG MAILGUN_DOMAIN
ENV MAILGUN_DOMAIN=$MAILGUN_DOMAIN
ARG MAILGUN_API_KEY
ENV MAILGUN_API_KEY=$MAILGUN_API_KEY
ARG MAILGUN_SENDER
ENV MAILGUN_SENDER=$MAILGUN_SENDER
ARG MAIL_PROVIDER
ENV MAIL_PROVIDER=$MAIL_PROVIDER
ARG EMAIL_TO
ENV EMAIL_TO=$EMAIL_TO
RUN npm run build
RUN npm prune --production
FROM node:21-alpine
WORKDIR /app
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY package.json .
EXPOSE 3000
ENV NODE_ENV=production
CMD [ "node", "build" ]