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 38 additions and 35 deletions
Showing only changes of commit 714738dcba - Show all commits

View File

@@ -1,13 +1,12 @@
FROM debian:12 AS base FROM debian:12 AS base
WORKDIR /opt/app WORKDIR /opt/app
ENV PYTHONPATH=/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 && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# install BunJs # install BunJs
RUN curl -fsSL https://bun.com/install | bash RUN curl -fsSL https://bun.com/install | bash
ENV PATH="/root/.bun/bin:$PATH" ENV PATH="/root/.bun/bin:$PATH"
# symlink python3 to python
RUN ln -s /usr/bin/python3 /usr/bin/python
# install dependencies into temp directory # install dependencies into temp directory
# this will cache them and speed up future builds # this will cache them and speed up future builds
@@ -17,8 +16,8 @@ COPY package.json bun.lock /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile RUN cd /temp/dev && bun install --frozen-lockfile
# and install python dependencies # and install python dependencies
COPY ./requirements.txt . COPY ./requirements.txt .
RUN pip3 install --break-system-packages -r ./requirements.txt RUN python3 -m pip install -r requirements.txt
# RUN python3 -m pip install -U python-dotenv
# install with --production (exclude devDependencies) # install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod RUN mkdir -p /temp/prod
COPY package.json bun.lock /temp/prod/ COPY package.json bun.lock /temp/prod/

View File

@@ -1,6 +1,7 @@
from dotenv import load_dotenv from dotenv import load_dotenv
import os import os
def main():
load_dotenv() # Load environment variables from .env file load_dotenv() # Load environment variables from .env file
ntfy_username = os.getenv('ntfy_username') ntfy_username = os.getenv('ntfy_username')
ntfy_password = os.getenv('ntfy_password') ntfy_password = os.getenv('ntfy_password')
@@ -35,3 +36,6 @@ apobj.notify(
body=args.body, body=args.body,
title=args.title title=args.title
) )
if __name__ == '__main__':
main()

View File

@@ -2,7 +2,7 @@ import * as Bun from "bun";
export async function sendNotification(title: string, body: string, click?: string | null) { export async function sendNotification(title: string, body: string, click?: string | null) {
const command = [ const command = [
"python", "python3",
"./src/notification.py", "./src/notification.py",
`--title=${title}`, `--title=${title}`,
`--body=${body}`, `--body=${body}`,