2019-08-03 18:45:06 -06:00
|
|
|
# Stage 0: Build the thing
|
2021-11-21 12:52:05 +00:00
|
|
|
# Need debian based image to build the native rust module
|
|
|
|
# as musl doesn't support cdylib
|
2021-11-21 12:34:56 +00:00
|
|
|
FROM node:16 AS builder
|
2019-08-03 18:45:06 -06:00
|
|
|
|
|
|
|
COPY . /src
|
|
|
|
WORKDIR /src
|
|
|
|
|
2021-11-21 13:21:58 +00:00
|
|
|
# We need rustup so we have a sensible rust version, the version packed with bullsye is too old
|
2022-01-31 20:27:10 +02:00
|
|
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal
|
2021-11-21 12:34:56 +00:00
|
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
|
2021-11-21 13:21:58 +00:00
|
|
|
# Workaround: Need to install esbuild manually https://github.com/evanw/esbuild/issues/462#issuecomment-771328459
|
2021-11-21 12:52:05 +00:00
|
|
|
RUN yarn --ignore-scripts
|
2021-11-21 13:21:58 +00:00
|
|
|
RUN node node_modules/esbuild/install.js
|
|
|
|
RUN yarn build
|
2019-08-03 18:45:06 -06:00
|
|
|
|
|
|
|
# Stage 1: The actual container
|
2021-11-21 13:21:58 +00:00
|
|
|
FROM node:16
|
2019-08-03 18:45:06 -06:00
|
|
|
|
2021-11-22 16:02:07 +00:00
|
|
|
COPY --from=builder /src/lib/ /bin/matrix-hookshot/
|
|
|
|
COPY --from=builder /src/public/ /bin/matrix-hookshot/public/
|
|
|
|
COPY --from=builder /src/package.json /bin/matrix-hookshot/
|
|
|
|
COPY --from=builder /src/yarn.lock /bin/matrix-hookshot/
|
|
|
|
WORKDIR /bin/matrix-hookshot
|
2020-12-13 13:35:10 +00:00
|
|
|
RUN yarn --production
|
2019-08-03 18:45:06 -06:00
|
|
|
|
|
|
|
VOLUME /data
|
|
|
|
EXPOSE 9993
|
|
|
|
EXPOSE 7775
|
|
|
|
|
2021-11-22 16:02:07 +00:00
|
|
|
CMD ["node", "/bin/matrix-hookshot/App/BridgeApp.js", "/data/config.yml", "/data/registration.yml"]
|