-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (22 loc) · 632 Bytes
/
Dockerfile
File metadata and controls
35 lines (22 loc) · 632 Bytes
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
FROM node:lts-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm i --omit=dev --ignore-scripts --no-audit
RUN npm i express
COPY api ./api
COPY src ./src
COPY themes ./themes
COPY vercel.json ./
COPY express.js ./
FROM node:lts-alpine
WORKDIR /app
COPY --from=builder /app /app
RUN mkdir -p /app/cache && chmod 777 /app/cache
RUN npm install -g dotenv-cli
RUN apk --no-cache add curl
ARG PORT=9000
ENV PORT=${PORT}
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f "http://localhost:${PORT:-9000}/api" || exit 1
EXPOSE ${PORT}
CMD ["dotenv", "--", "node", "express.js"]