Skip to main content
Module

x/esm/Dockerfile

A fast, smart, & global CDN for modern(es2015+) web development.
Latest
File
####################################################### Build Stage######################################################FROM golang:1.22-alpine AS build-stage
ENV ESM_SH_VERSION v135_2ENV ESM_SH_GIT_URL https://github.com/esm-dev/esm.sh
RUN apk update && apk add --no-cache gitRUN git clone --branch $ESM_SH_VERSION --depth 1 $ESM_SH_GIT_URL /tmp/esm.sh
WORKDIR /tmp/esm.shRUN CGO_ENABLED=0 GOOS=linux go build -o esmd main.go
####################################################### Release Stage######################################################FROM node:20-alpine AS release-stage
RUN apk update && apk add --no-cache git libcap-utilsRUN npm i -g pnpm
COPY --from=build-stage /tmp/esm.sh/esmd /bin/esmdRUN setcap cap_net_bind_service=ep /bin/esmdRUN chown node:node /bin/esmd
USER nodeWORKDIR /EXPOSE 8080CMD ["esmd"]