File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Generates a container to run the compiled node.js scripts in
2+ # -> Runs as the "node" user so any extra folders will need to be chown-ed
3+ # -> Uses a multi-stage to compile JavaScript and produce a slim image
4+
5+ # [0] A common base for both stages
6+ FROM node:22-alpine AS base
7+ WORKDIR /app
8+ RUN chown -R node:node /app
9+ USER node
10+ COPY --chown=node ["package*.json" , "tsconfig.json" , "/app/" ]
11+ COPY --chown=node ["cli/package.json" , "/app/cli/" ]
12+
13+ # [1] A builder to install modules and run a build
14+ FROM base AS builder
15+ ENV NODE_ENV=development
16+ RUN npm ci
17+ COPY --chown=node ["cli" , "/app/cli" ]
18+ RUN npm run --workspace=cli build
19+ RUN wget -O- https://github.com/protomaps/go-pmtiles/releases/download/v1.28.0/go-pmtiles_1.28.0_Linux_x86_64.tar.gz | tar -xzC /tmp
20+ # && npm run --workspace=cli test \
21+
22+ # [2] From the base again, install production dependencies and copy compiled code
23+ FROM base AS dist
24+ ENV NODE_ENV=production
25+ RUN npm ci -w cli && npm cache clean --force
26+ COPY --from=builder --chown=node ["/app/cli/dist/" , "/app/cli/" ]
27+ COPY --from=builder --chown=node ["/tmp/pmtiles" , "/usr/local/bin/pmtiles" ]
28+ WORKDIR /app
29+ ENTRYPOINT ["node" , "cli/main.js" ]
30+ CMD ["serve" ]
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ../tsconfig.json" ,
3+ "include" : [" ." ],
4+ "exclude" : [" node_modules" , " dist" ],
5+ "compilerOptions" : {
6+ "outDir" : " dist"
7+ }
8+ }
Original file line number Diff line number Diff line change 2121 "noFallthroughCasesInSwitch" : true ,
2222 "noUncheckedSideEffectImports" : true ,
2323 "forceConsistentCasingInFileNames" : true ,
24- "erasableSyntaxOnly" : true ,
25- "verbatimModuleSyntax" : true
24+ "erasableSyntaxOnly" : true
25+ // "verbatimModuleSyntax": true
2626 },
2727 "include" : [" cli" ],
2828 "exclude" : [" node_modules" ]
You can’t perform that action at this time.
0 commit comments