-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
41 lines (29 loc) · 982 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
39
40
41
FROM node:20.16.0-alpine AS development
WORKDIR /app
RUN apk --no-cache add --virtual native-deps \
g++ gcc libgcc libstdc++ linux-headers make python3 git \
chromium chromium-chromedriver curl
COPY package.json pnpm-lock.yaml /app/
ENV PNPM_HOME="/pnpm"
RUN corepack enable && corepack install
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install
COPY knexfile.ts knex-esm-compat.ts .prettierrc vitest.config.ts eslint.config.mjs ./
COPY ./src /app/src
COPY ./test /app/test
COPY ./views /app/views
COPY ./scss /app/scss
COPY ./public /app/public
COPY ./locales /app/locales
COPY ./seeds /app/seeds
COPY ./migrations /app/migrations
COPY ./scripts /app/scripts
COPY tsconfig.json ./
HEALTHCHECK CMD curl -f http://localhost:3030/ping || exit 1
EXPOSE 3001
CMD ["pnpm", "run", "watch"]
FROM development AS production
RUN pnpm run build && \
pnpm prune --prod
EXPOSE 3001
CMD ["pnpm", "start"]
HEALTHCHECK CMD curl -f http://localhost:3030/ping || exit 1