focalboard/docker/Dockerfile
Marco 12e793b7ad
recreate dockerfile (#168)
This commit recreates the entire dockerfile for several reasons:
* compile focalboard instead of downloading and extracting a tarball
* it uses an alpine image and intermediate containers to obtain a much
  smaller image
* run focalboard as user inside the container instead of root

Co-authored-by: Jesús Espino <jespinog@gmail.com>
2021-04-28 16:55:29 +02:00

38 lines
962 B
Docker

FROM golang:alpine as gobuild
RUN apk update && \
apk add ca-certificates gcc git make musl-dev && \
git clone https://github.com/mattermost/focalboard && \
cd focalboard && \
make server-linux
FROM node:alpine as nodebuild
RUN apk update && \
apk add ca-certificates git && \
git clone https://github.com/mattermost/focalboard && \
cd focalboard/webapp && \
npm install && npm run pack
FROM alpine:latest
ARG PUID=2000
ARG PGID=2000
EXPOSE 8000/tcp
RUN addgroup -g ${PGID} focalboard && \
adduser -H -D -u ${PUID} -G focalboard focalboard
WORKDIR /opt/focalboard
COPY --from=gobuild /go/focalboard/bin/linux/focalboard-server bin/
COPY --from=nodebuild /focalboard/webapp/pack pack/
COPY --from=nodebuild /focalboard/LICENSE.txt LICENSE.txt
COPY --from=nodebuild /focalboard/server-config.json config.json
RUN chown -R ${PUID}:${PGID} /opt/focalboard
USER focalboard
CMD ["/opt/focalboard/bin/focalboard-server"]