fix-docker #1

Merged
chiko merged 12 commits from fix-docker into main 2025-10-21 00:52:32 +00:00
3 changed files with 44 additions and 8 deletions
Showing only changes of commit 457a49e754 - Show all commits

View File

@@ -1,6 +1,7 @@
FROM debian:12 AS base FROM debian:12 AS base
WORKDIR /opt/app WORKDIR /opt/app
RUN apt-get update && \ RUN apt-get update && \
# apt-get install -y curl unzip cron ca-certificates python3 python3-pip && \
apt-get install -y curl unzip cron ca-certificates python3 python3-pip && \ apt-get install -y curl unzip cron ca-certificates python3 python3-pip && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# install BunJs # install BunJs
@@ -19,8 +20,8 @@ COPY package.json bun.lock /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production RUN cd /temp/prod && bun install --frozen-lockfile --production
# and install python dependencies # and install python dependencies
COPY ./requirements.txt . # COPY ./requirements.txt .
RUN python3 -m pip install --break-system-packages -r requirements.txt # RUN python3 -m pip install --break-system-packages -r requirements.txt
# RUN python3 -m pip install -U python-dotenv # RUN python3 -m pip install -U python-dotenv
# copy node_modules from temp directory # copy node_modules from temp directory

View File

@@ -2,4 +2,21 @@ services:
app: app:
build: . build: .
volumes: volumes:
- ./data/db:/opt/app/data/db - ./data/db:/opt/app/data/db
apprise:
image: caronc/apprise:latest
environment:
- APPRISE_WORKER_COUNT=1
- APPRISE_STATEFUL_MODE=simple
- PUID=$(id -u)
- PGID=$(id -g)
volumes:
- ./data/apprise/config:/config
- ./data/apprise/plugin:/plugin
- ./data/apprise/attach:/attach
ports:
- 8000:8000
networks:
default:
external: true
name: npm

View File

@@ -112,11 +112,29 @@ async function main( ) {
} }
return false; return false;
})( ev ); })( ev );
await sendNotification( const title = `${today_prefix ? "TODAY " : ""}${notification_prefix ? notification_prefix + ": " : ""} ${ev.title} (${ TEventType[ ev.event_type ] })`;
`${today_prefix ? "TODAY " : ""}${notification_prefix ? notification_prefix + ": " : ""} ${ev.title} (${ TEventType[ ev.event_type ] })`,
`${body}` await fetch("http://localhost:8000/notify", {
// `${ev.link || "https://77th-jsoc.com/#/events"}` method: "POST",
); headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
urls: [
`ntfys://${process.env.ntfy_username}:${process.env.ntfy_password}@${process.env.ntfy_host}/${process.env.ntfy_topic}${ ev.link ? `?click=${ev.link}`: "?click=https://77th-jsoc.com/#/events" }`,
`discord://${process.env.dc_webhook}?avatar_url=${process.env.dc_avatar_url}&botname=${process.env.dc_botname}`
].join(","),
title: title,
body: body,
format: "text"
})
});
// await sendNotification(
// title,
// body
// // `${ev.link || "https://77th-jsoc.com/#/events"}`
// );
ev.set_notification("done", db); ev.set_notification("done", db);
} }
}; };