Skip to content

Instantly share code, notes, and snippets.

@zihu12
Last active July 22, 2024 17:10
Show Gist options
  • Save zihu12/5b8894deb696d119a0dc5ed1920b8596 to your computer and use it in GitHub Desktop.
Save zihu12/5b8894deb696d119a0dc5ed1920b8596 to your computer and use it in GitHub Desktop.
Dockerfile for huangz1342/icalingua-bridge-oicq
# build.sh
# Copyright (c) zihu12
# License: AGPL-3.0
#!/bin/bash
#export VERSION=2.12.2
#Just remove the 'v' from upstream tag name to keep image names persistent
export VERSION=$(curl https://api.github.com/repos/Icalingua-plus-plus/Icalingua-plus-plus/releases/latest |jq -r .tag_name |cut -c 2-)
docker build --build-arg VERSION=$VERSION -t huangz1342/icalingua-bridge-oicq:latest -t huangz1342/icalingua-bridge-oicq:$VERSION - < ./Dockerfile
docker push -a docker.io/huangz1342/icalingua-bridge-oicq
# Dockerfile for icalingua-bridge-oicq
# Based on code from https://github.com/Icalingua-plus-plus/Icalingua-plus-plus (licensed under AGPL-3.0)
# Copyright (c) zihu12
# License: AGPL-3.0
FROM docker.io/library/node:18 AS build
ARG VERSION
RUN git clone https://github.com/Icalingua-plus-plus/Icalingua-plus-plus.git --depth=1 -b v$VERSION
WORKDIR /Icalingua-plus-plus/icalingua-bridge-oicq
RUN corepack enable && npm install -g node-prune
RUN pnpm install
RUN pnpm compile
RUN mv /Icalingua-plus-plus/icalingua-bridge-oicq/build/ /opt/build/ && cp -f /Icalingua-plus-plus/.npmrc /opt/build/.npmrc
WORKDIR /opt/build/
ENV NODE_ENV=production
RUN pnpm install && pnpm install uuid body-parser lodash
RUN node-prune
RUN pnpm install sqlite3 && rm -f .npmrc
WORKDIR /Icalingua-plus-plus/
RUN wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz && tar xf ffmpeg-release-amd64-static.tar.xz \
&& mv ffmpeg*/ffmpeg /Icalingua-plus-plus/ffmpeg
FROM docker.io/library/node:18-slim
COPY --from=build --chown=node:node /opt/build/ opt/build
COPY --from=build /Icalingua-plus-plus/ffmpeg /usr/local/bin
VOLUME [ "/opt/build/data" ]
WORKDIR /opt/build
EXPOSE 6789/tcp
CMD [ "node","index" ]
@zihu12
Copy link
Author

zihu12 commented Jan 29, 2024

以及还有个问题…… ica archive了……

有吗?

@shenjackyuanjie
Copy link

好,又不archive了(
昨天还在的(

@zihu12
Copy link
Author

zihu12 commented Jan 30, 2024

好,又不archive了( 昨天还在的(

反正我直接开ready for review了(
就那样吧(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment