-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
68 lines (56 loc) · 1.96 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM node:22.10.0-alpine AS remix
WORKDIR /app
COPY ./package-production.json ./package.json
RUN npm i --frozen-lockfile
FROM node:22.10.0-alpine AS install
RUN apk update && apk add python3 make g++
RUN npm i -g [email protected]
WORKDIR /app
COPY ./package.json ./package.json
COPY ./pnpm-lock.yaml ./pnpm-lock.yaml
# typecheck
ARG APP
ENV APP=${APP}
COPY ./src/generated/package.json ./src/generated/pnpm-lock.yaml ./src/generated/
COPY ./src/generated/plugin/package.json ./src/generated/plugin/pnpm-lock.yaml ./src/generated/plugin/
RUN pnpm i -p --frozen-lockfile
FROM node:22.10.0-alpine AS build
RUN npm i -g [email protected]
WORKDIR /app
ARG APP
ENV APP=${APP}
COPY --from=install /app/node_modules ./node_modules
COPY ./src/generated ./src/generated
COPY --from=install /app/src/generated/node_modules ./src/generated/node_modules
COPY --from=install /app/src/generated/plugin/node_modules ./src/generated/plugin/node_modules
COPY ./static/common/. ./public
COPY ./static/${APP}/. ./public
# lib
COPY ./lib ./lib
# typecheck
COPY ./gql-queries-generator/loader.ts ./gql-queries-generator/loader.ts
COPY ./fake-data-generator/gen.ts ./fake-data-generator/gen.ts
COPY ./gql-queries-generator/${APP}.ts ./gql-queries-generator/index.ts
COPY ./tsconfig-compile.json ./tsconfig-compile.json
# app
COPY ./src/apps/${APP} ./src/apps/${APP}
COPY ./tailwind.config.js ./tailwind.config.js
COPY ./tailwind-base.js ./tailwind-base.js
COPY ./remix.config.js ./remix.config.js
COPY ./pnpm-lock.yaml ./pnpm-lock.yaml
COPY ./package.json ./package.json
COPY ./tsconfig.json ./tsconfig.json
COPY ./remix.env.d.ts ./remix.env.d.ts
COPY ./css-plugins ./css-plugins
COPY ./index.css ./index.css
RUN pnpm build:ts
FROM node:22.10.0-alpine
WORKDIR /app
ARG APP
ENV APP=${APP}
COPY ./package-production.json ./package.json
COPY ./static/common/. ./public
COPY ./static/${APP}/. ./public
COPY --from=build /app/public ./public
COPY --from=remix /app/node_modules ./node_modules
ENTRYPOINT ["npm", "run", "serve"]