1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-03 08:45:40 +02:00
focalboard/docker/Dockerfile
jingkai 6df2dd93dd
fix: fixed user nobody not owning /data (#683)
Co-authored-by: Hossein <hahmadia@users.noreply.github.com>
Co-authored-by: Carlos Tadeu Panato Junior <carlos@mattermost.com>
2021-07-20 15:01:02 +02:00

39 lines
865 B
Docker

### Webapp build
FROM node:16.3.0 as nodebuild
WORKDIR /webapp
ADD webapp/ /webapp
RUN npm install --no-optional && \
npm run pack
### Go build
FROM golang:1.16.5 as gobuild
WORKDIR /go/src/focalboard
ADD . /go/src/focalboard
RUN make server-linux
RUN mkdir /data
## Final image
FROM gcr.io/distroless/base-debian10
WORKDIR /opt/focalboard
COPY --from=gobuild --chown=nobody:nobody /data /data
COPY --from=nodebuild --chown=nobody:nobody /webapp/pack pack/
COPY --from=gobuild --chown=nobody:nobody /go/src/focalboard/bin/linux/focalboard-server bin/
COPY --from=gobuild --chown=nobody:nobody /go/src/focalboard/LICENSE.txt LICENSE.txt
COPY --from=gobuild --chown=nobody:nobody /go/src/focalboard/docker/server_config.json config.json
USER nobody
EXPOSE 8000/tcp
EXPOSE 8000/tcp 9092/tcp
VOLUME /data
CMD ["/opt/focalboard/bin/focalboard-server"]