forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1FROM golang:1.25-bookworm AS build-env
2
3WORKDIR /usr/src/social-app
4
5ENV DEBIAN_FRONTEND=noninteractive
6
7# Node
8ENV NODE_VERSION=20
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/css/empty.txt
44RUN touch bskyweb/static/media/empty.txt
45
46#
47# Generate the embedr Go binary.
48#
49RUN cd bskyweb/ && \
50 go mod download && \
51 go mod verify
52
53RUN cd bskyweb/ && \
54 go build \
55 -v \
56 -trimpath \
57 -tags timetzdata \
58 -o /embedr \
59 ./cmd/embedr
60
61FROM debian:bookworm-slim
62
63ENV GODEBUG=netdns=go
64ENV TZ=Etc/UTC
65ENV DEBIAN_FRONTEND=noninteractive
66
67RUN apt-get update && apt-get install --yes \
68 dumb-init \
69 ca-certificates
70
71ENTRYPOINT ["dumb-init", "--"]
72
73WORKDIR /embedr
74COPY --from=build-env /embedr /usr/bin/embedr
75
76CMD ["/usr/bin/embedr"]
77
78LABEL org.opencontainers.image.source=https://github.com/bluesky-social/social-app
79LABEL org.opencontainers.image.description="embed.bsky.app Web App"
80LABEL org.opencontainers.image.licenses=MIT