summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile26
1 files changed, 8 insertions, 18 deletions
diff --git a/Dockerfile b/Dockerfile
index b069b9830..a4beea7ec 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,5 +1,7 @@
+# syntax=docker/dockerfile:1.3
+
# bundle the admin webapp
-FROM node:17.6.0-alpine3.15 AS admin_builder
+FROM --platform=${BUILDPLATFORM} node:17.6.0-alpine3.15 AS admin_builder
RUN apk update && apk upgrade --no-cache
RUN apk add git
@@ -9,28 +11,16 @@ WORKDIR /gotosocial-admin
RUN npm install
RUN node index.js
-FROM alpine:3.15.0 AS executor
-RUN apk update && apk upgrade --no-cache
+FROM --platform=${TARGETPLATFORM} alpine:3.15.0 AS executor
# copy over the binary from the first stage
-RUN mkdir -p /gotosocial/storage
-COPY gotosocial /gotosocial/gotosocial
+COPY --chown=1000:1000 gotosocial /gotosocial/gotosocial
# copy over the web directory with templates etc
-COPY web /gotosocial/web
+COPY --chown=1000:1000 web /gotosocial/web
# copy over the admin directory
-COPY --from=admin_builder /gotosocial-admin/public /gotosocial/web/assets/admin
-
-# make the gotosocial group and user
-RUN addgroup -g 1000 gotosocial
-RUN adduser -HD -u 1000 -G gotosocial gotosocial
-
-# give ownership of the gotosocial dir to the new user
-RUN chown -R gotosocial gotosocial /gotosocial
-
-# become the user
-USER gotosocial
+COPY --chown=1000:1000 --from=admin_builder /gotosocial-admin/public /gotosocial/web/assets/admin
-WORKDIR /gotosocial
+WORKDIR "/gotosocial"
ENTRYPOINT [ "/gotosocial/gotosocial", "server", "start" ]