2024-04-14 03:38:00 +02:00
|
|
|
# gitzone dockerfile_service
|
|
|
|
|
## STAGE 1 // BUILD
|
2026-04-29 12:58:06 +00:00
|
|
|
FROM code.foss.global/host.today/ht-docker-node:lts AS build
|
|
|
|
|
|
2024-04-14 03:38:00 +02:00
|
|
|
WORKDIR /app
|
2026-04-29 12:58:06 +00:00
|
|
|
|
|
|
|
|
COPY package.json pnpm-lock.yaml ./
|
2024-04-14 03:38:00 +02:00
|
|
|
RUN pnpm config set store-dir .pnpm-store
|
2026-04-29 12:58:06 +00:00
|
|
|
RUN pnpm config set registry https://verdaccio.lossless.digital
|
|
|
|
|
RUN pnpm install --frozen-lockfile
|
2024-04-14 03:38:00 +02:00
|
|
|
|
2026-04-29 12:58:06 +00:00
|
|
|
COPY . ./
|
|
|
|
|
# The npm package builds both Rust targets; each OCI image only needs its native binary.
|
|
|
|
|
RUN node -e "const fs=require('node:fs');const p='.smartconfig.json';const c=JSON.parse(fs.readFileSync(p,'utf8'));c['@git.zone/tsrust']={...(c['@git.zone/tsrust']||{}),targets:[]};fs.writeFileSync(p,JSON.stringify(c));" \
|
|
|
|
|
&& pnpm exec tsbuild tsfolders --allowimplicitany \
|
|
|
|
|
&& pnpm exec tsrust
|
2024-04-14 03:38:00 +02:00
|
|
|
RUN rm -rf .pnpm-store
|
2026-04-29 12:58:06 +00:00
|
|
|
RUN pnpm prune --prod
|
2024-04-14 03:38:00 +02:00
|
|
|
|
2026-04-29 12:58:06 +00:00
|
|
|
## STAGE 2 // PRODUCTION
|
|
|
|
|
FROM code.foss.global/host.today/ht-docker-node:alpine-node AS production
|
2024-04-14 03:38:00 +02:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-04-29 12:58:06 +00:00
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
|
|
|
|
|
COPY --from=build /app/package.json ./package.json
|
|
|
|
|
COPY --from=build /app/node_modules ./node_modules
|
|
|
|
|
COPY --from=build /app/cli.js ./cli.js
|
|
|
|
|
COPY --from=build /app/dist_ts ./dist_ts
|
|
|
|
|
COPY --from=build /app/dist_rust ./dist_rust
|
2024-04-14 03:38:00 +02:00
|
|
|
|
2026-04-29 12:58:06 +00:00
|
|
|
LABEL org.opencontainers.image.title="remoteingress" \
|
|
|
|
|
org.opencontainers.image.description="serve.zone edge ingress tunnel" \
|
|
|
|
|
org.opencontainers.image.source="https://code.foss.global/serve.zone/remoteingress"
|
2024-04-14 03:38:00 +02:00
|
|
|
|
2026-04-29 12:58:06 +00:00
|
|
|
EXPOSE 80 443 8443 53/udp
|
|
|
|
|
CMD ["node", "cli.js"]
|