2021-09-24 14:14:20 +03:00
|
|
|
# bundle the admin webapp
|
2021-09-11 17:21:24 +03:00
|
|
|
FROM node:16.9.0-alpine3.14 AS admin_builder
|
2021-07-27 15:45:27 +03:00
|
|
|
RUN apk update && apk upgrade --no-cache
|
|
|
|
RUN apk add git
|
|
|
|
|
|
|
|
RUN git clone https://github.com/superseriousbusiness/gotosocial-admin
|
|
|
|
WORKDIR /gotosocial-admin
|
|
|
|
|
|
|
|
RUN npm install
|
|
|
|
RUN node index.js
|
|
|
|
|
2021-09-11 17:21:24 +03:00
|
|
|
FROM alpine:3.14.2 AS executor
|
2021-05-24 00:43:04 +03:00
|
|
|
RUN apk update && apk upgrade --no-cache
|
|
|
|
|
|
|
|
# copy over the binary from the first stage
|
|
|
|
RUN mkdir -p /gotosocial/storage
|
2021-09-24 14:14:20 +03:00
|
|
|
COPY gotosocial /gotosocial/gotosocial
|
2021-05-24 00:43:04 +03:00
|
|
|
|
|
|
|
# copy over the web directory with templates etc
|
2021-09-24 14:14:20 +03:00
|
|
|
COPY web /gotosocial/web
|
2021-08-02 20:06:44 +03:00
|
|
|
|
2021-07-27 15:45:27 +03:00
|
|
|
# copy over the admin directory
|
|
|
|
COPY --from=admin_builder /gotosocial-admin/public /gotosocial/web/assets/admin
|
2021-05-24 00:43:04 +03:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
WORKDIR /gotosocial
|
|
|
|
ENTRYPOINT [ "/gotosocial/gotosocial", "server", "start" ]
|