mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
at verify-code 1.7 kB view raw
1FROM golang:1.22-bullseye AS build-env 2 3WORKDIR /usr/src/social-app 4 5ENV DEBIAN_FRONTEND=noninteractive 6 7# Node 8ENV NODE_VERSION=18 9ENV NVM_DIR=/usr/share/nvm 10 11# Go 12ENV GODEBUG="netdns=go" 13ENV GOOS="linux" 14ENV GOARCH="amd64" 15ENV CGO_ENABLED=1 16ENV GOEXPERIMENT="loopvar" 17 18COPY . . 19 20# 21# Generate the JavaScript webpack. NOTE: this will change 22# 23RUN mkdir --parents $NVM_DIR && \ 24 wget \ 25 --output-document=/tmp/nvm-install.sh \ 26 https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh && \ 27 bash /tmp/nvm-install.sh 28 29RUN \. "$NVM_DIR/nvm.sh" && \ 30 nvm install $NODE_VERSION && \ 31 nvm use $NODE_VERSION && \ 32 npm install --global yarn && \ 33 yarn && \ 34 cd bskyembed && yarn install --frozen-lockfile && cd .. && \ 35 yarn intl:build && \ 36 yarn build-embed 37 38# DEBUG 39RUN find ./bskyweb/embedr-static && find ./bskyweb/embedr-templates && find ./bskyembed/dist 40 41# hack around issue with empty directory and go:embed 42RUN touch bskyweb/static/js/empty.txt 43RUN touch bskyweb/static/media/empty.txt 44 45# 46# Generate the embedr Go binary. 47# 48RUN cd bskyweb/ && \ 49 go mod download && \ 50 go mod verify 51 52RUN cd bskyweb/ && \ 53 go build \ 54 -v \ 55 -trimpath \ 56 -tags timetzdata \ 57 -o /embedr \ 58 ./cmd/embedr 59 60FROM debian:bullseye-slim 61 62ENV GODEBUG=netdns=go 63ENV TZ=Etc/UTC 64ENV DEBIAN_FRONTEND=noninteractive 65 66RUN apt-get update && apt-get install --yes \ 67 dumb-init \ 68 ca-certificates 69 70ENTRYPOINT ["dumb-init", "--"] 71 72WORKDIR /embedr 73COPY --from=build-env /embedr /usr/bin/embedr 74 75CMD ["/usr/bin/embedr"] 76 77LABEL org.opencontainers.image.source=https://github.com/bluesky-social/social-app 78LABEL org.opencontainers.image.description="embed.bsky.app Web App" 79LABEL org.opencontainers.image.licenses=MIT