You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
1.1 KiB

FROM golang:1.16-alpine3.13 AS gobuilder
RUN apk add --no-cache gcc libc-dev git sqlite-dev
4 years ago
COPY . /src
WORKDIR /src/cmd/webmentiond
RUN go build --tags "libsqlite3 linux"
4 years ago
FROM node:12-alpine3.12 AS nodebuilder
4 years ago
COPY frontend /src/frontend
WORKDIR /src/frontend
RUN yarn && yarn run webpack --mode production
4 years ago
FROM alpine:3.13
RUN apk add --no-cache sqlite-dev
4 years ago
VOLUME ["/data"]
RUN adduser -u 1500 -h /data -H -D webmentiond && \
mkdir -p /var/lib/webmentiond/frontend
4 years ago
COPY pkg/server/migrations /var/lib/webmentiond/migrations
COPY --from=gobuilder /src/cmd/webmentiond/webmentiond /usr/local/bin/
COPY --from=nodebuilder /src/frontend/dist /var/lib/webmentiond/frontend/dist
COPY --from=nodebuilder /src/frontend/css /var/lib/webmentiond/frontend/css
COPY --from=nodebuilder /src/frontend/index.html /var/lib/webmentiond/frontend/
COPY --from=nodebuilder /src/frontend/demo.html /var/lib/webmentiond/frontend/
4 years ago
WORKDIR /var/lib/webmentiond
USER 1500
4 years ago
ENTRYPOINT ["/usr/local/bin/webmentiond", "serve", "--database-migrations", "/var/lib/webmentiond/migrations", "--database", "/data/webmentiond.sqlite"]