Skip to main content
Module

x/esm/Dockerfile

A fast, smart, & global CDN for modern(es2015+) web development.
Go to Latest
File
######################################### Build Stage########################################FROM golang:1.20-alpine AS build-stage
RUN apk update && apk add --no-cache gitRUN git clone --branch main --depth 1 https://github.com/esm-dev/esm.sh /tmp/esm.sh
WORKDIR /tmp/esm.shRUN CGO_ENABLED=0 GOOS=linux go build -o esmd main.go
######################################### Release Stage########################################FROM node:18-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"]