repackage properly

This commit is contained in:
2025-11-23 21:11:06 -08:00
parent f1c8895194
commit f973ead318
9 changed files with 246 additions and 36 deletions

View File

@@ -1,27 +1,34 @@
FROM python:3-alpine AS pybuilder
COPY . .
RUN apk add py3-uv
RUN uv build
# Use an official Node.js runtime as a base
FROM node:20-alpine
FROM node:20-alpine AS runtime
# Create app directory
WORKDIR /app
RUN apk add python3 py3-pip
RUN apk add python3 py3-pip py3-uv
# RUN pip install uv
# Copy package.json and install dependencies
COPY package*.json ./
RUN npm install --omit=dev
# Copy requirements.txt and install dependencies
COPY requirements.txt ./
RUN pip3 install --no-cache-dir --break-system-packages -r requirements.txt
# Copy wheel from builder and install
COPY --from=pybuilder dist/*.whl /app/dist/
RUN uv pip install --system --break-system-packages /app/dist/*.whl
RUN rm -r /app/dist/
# Copy the rest of the app
COPY . .
COPY cli.js .
# Make the script executable
RUN chmod +x cli.js
RUN chmod +x watcher.py
# Make ephemeral cache directory
RUN mkdir ./cache
ENTRYPOINT /app/watcher.py
ENTRYPOINT actual-imap-poll