about summary refs log tree commit diff
path: root/Dockerfile
diff options
context:
space:
mode:
authorJake Gold <52801504+Jacob2161@users.noreply.github.com>2023-03-20 14:41:15 -0700
committerGitHub <noreply@github.com>2023-03-20 14:41:15 -0700
commit67e4882bb372bc45d178e3eacc409cdbf60f1344 (patch)
tree13e3c015e91b5009597d9b610a9c6a40764cbfcc /Dockerfile
parentd8f4475696094382e2196ce259af358b65c849fb (diff)
downloadvoidsky-67e4882bb372bc45d178e3eacc409cdbf60f1344.tar.zst
bskyweb additions (#296)
Add some minor bskyweb improvements, Mailmodo endpoint, Dockerfile for bskyweb, container image push
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile75
1 files changed, 75 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..95f0ec02e
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,75 @@
+FROM golang:1.20-bullseye AS build-env
+
+WORKDIR /usr/src/social-app
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+# Node
+ENV NODE_VERSION=18
+ENV NVM_DIR=/usr/share/nvm
+
+# Go
+ENV GODEBUG="netdns=go"
+ENV GOOS="linux"
+ENV GOARCH="amd64"
+ENV CGO_ENABLED=1
+
+COPY . .
+
+#
+# Generate the Javascript webpack.
+#
+RUN mkdir --parents $NVM_DIR && \
+  wget \
+    --output-document=/tmp/nvm-install.sh \
+    https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh && \
+  bash /tmp/nvm-install.sh
+
+RUN \. "$NVM_DIR/nvm.sh" && \
+  nvm install $NODE_VERSION && \
+  nvm use $NODE_VERSION && \
+  npm install --global yarn && \
+  yarn && \
+  yarn build-web
+
+# DEBUG
+RUN find ./bskyweb/static && find ./web-build/static
+
+# Copy the bundle js files.
+RUN cp --verbose ./web-build/static/js/*.* ./bskyweb/static/js/
+
+#
+# Generate the bksyweb Go binary.
+#
+RUN cd bskyweb/ && \
+  go mod download && \
+  go mod verify
+
+RUN cd bskyweb/ && \
+  go build \
+    -v  \
+    -trimpath \
+    -tags timetzdata \
+    -o /bskyweb \
+    ./cmd/bskyweb
+
+FROM debian:bullseye-slim
+
+ENV GODEBUG=netdns=go
+ENV TZ=Etc/UTC
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update && apt-get install --yes \
+  dumb-init \
+  ca-certificates
+
+ENTRYPOINT ["dumb-init", "--"]
+
+WORKDIR /bskyweb
+COPY --from=build-env /bskyweb /usr/bin/bskyweb
+
+CMD ["/usr/bin/bskyweb"]
+
+LABEL org.opencontainers.image.source=https://github.com/bluesky-social/social-app
+LABEL org.opencontainers.image.description="bsky.app Web App"
+LABEL org.opencontainers.image.licenses=MIT