2021-07-01 11:46:03 +02:00
|
|
|
### Webapp build
|
2022-03-18 19:57:26 +02:00
|
|
|
FROM node:16.3.0@sha256:ca6daf1543242acb0ca59ff425509eab7defb9452f6ae07c156893db06c7a9a4 as nodebuild
|
2021-03-17 19:07:04 +02:00
|
|
|
|
2021-07-01 11:46:03 +02:00
|
|
|
WORKDIR /webapp
|
|
|
|
ADD webapp/ /webapp
|
2021-03-18 08:57:33 +02:00
|
|
|
|
2022-11-11 17:28:23 +02:00
|
|
|
### 'CPPFLAGS="-DPNG_ARM_NEON_OPT=0"' Needed To Avoid Bug Described in: https://github.com/imagemin/optipng-bin/issues/118#issuecomment-1019838562
|
|
|
|
### Can be Removed when Ticket will be Closed
|
|
|
|
RUN CPPFLAGS="-DPNG_ARM_NEON_OPT=0" npm install --no-optional && \
|
2021-07-01 11:46:03 +02:00
|
|
|
npm run pack
|
2021-03-17 19:07:04 +02:00
|
|
|
|
2021-07-01 11:46:03 +02:00
|
|
|
### Go build
|
2022-06-06 10:18:21 +02:00
|
|
|
FROM golang:1.18.3@sha256:b203dc573d81da7b3176264bfa447bd7c10c9347689be40540381838d75eebef AS gobuild
|
2021-04-28 16:55:29 +02:00
|
|
|
|
2021-07-01 11:46:03 +02:00
|
|
|
WORKDIR /go/src/focalboard
|
|
|
|
ADD . /go/src/focalboard
|
2021-04-28 16:55:29 +02:00
|
|
|
|
2022-11-11 17:28:23 +02:00
|
|
|
# Get target architecture
|
|
|
|
ARG TARGETOS
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
|
|
|
RUN EXCLUDE_PLUGIN=true EXCLUDE_SERVER=true EXCLUDE_ENTERPRISE=true make server-docker os=${TARGETOS} arch=${TARGETARCH}
|
2021-04-28 16:55:29 +02:00
|
|
|
|
2021-07-01 11:46:03 +02:00
|
|
|
## Final image
|
2022-11-10 20:28:28 +02:00
|
|
|
FROM debian:buster-slim@sha256:5b0b1a9a54651bbe9d4d3ee96bbda2b2a1da3d2fa198ddebbced46dfdca7f216
|
|
|
|
|
|
|
|
RUN mkdir -p /opt/focalboard/data/files
|
|
|
|
RUN chown -R nobody:nogroup /opt/focalboard
|
2021-04-28 16:55:29 +02:00
|
|
|
|
2021-07-01 11:46:03 +02:00
|
|
|
WORKDIR /opt/focalboard
|
2021-06-07 11:20:32 +02:00
|
|
|
|
2022-11-10 20:28:28 +02:00
|
|
|
COPY --from=nodebuild --chown=nobody:nogroup /webapp/pack pack/
|
2022-11-11 17:28:23 +02:00
|
|
|
COPY --from=gobuild --chown=nobody:nogroup /go/src/focalboard/bin/docker/focalboard-server bin/
|
2022-11-10 20:28:28 +02:00
|
|
|
COPY --from=gobuild --chown=nobody:nogroup /go/src/focalboard/LICENSE.txt LICENSE.txt
|
|
|
|
COPY --from=gobuild --chown=nobody:nogroup /go/src/focalboard/docker/server_config.json config.json
|
2021-03-17 19:07:04 +02:00
|
|
|
|
2021-07-01 11:46:03 +02:00
|
|
|
USER nobody
|
2021-03-17 19:07:04 +02:00
|
|
|
|
2021-07-01 11:46:03 +02:00
|
|
|
EXPOSE 8000/tcp
|
2021-04-28 16:55:29 +02:00
|
|
|
|
2021-07-01 11:46:03 +02:00
|
|
|
EXPOSE 8000/tcp 9092/tcp
|
2021-04-28 16:55:29 +02:00
|
|
|
|
2022-11-10 20:28:28 +02:00
|
|
|
VOLUME /opt/focalboard/data
|
2021-04-28 16:55:29 +02:00
|
|
|
|
|
|
|
CMD ["/opt/focalboard/bin/focalboard-server"]
|