From ec2bbfb203010f8b2205bf263b82ada647800958 Mon Sep 17 00:00:00 2001 From: Index <57020946+indexxing@users.noreply.github.com> Date: Fri, 20 Feb 2026 03:12:18 -0600 Subject: [PATCH] feat: Docker --- Dockerfile | 48 ++++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 21 ++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fcd46cc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,48 @@ +# Use Node 22 as required by the project +FROM node:22-slim AS builder + +# Install build essentials for native modules (better-sqlite3) +RUN apt-get update && apt-get install -y \ + python3 \ + make \ + g++ \ + git \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +# Install dependencies +COPY package*.json ./ +RUN npm install + +# Copy source and build both server and web dashboard +COPY . . +RUN npm run build + +# --- Production Image --- +FROM node:22-slim + +# Install runtime dependencies (Puppeteer/Chromium dependencies if needed) +RUN apt-get update && apt-get install -y \ + chromium \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +# Copy built files and production node_modules +COPY --from=builder /app/dist ./dist +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/package.json ./package.json +COPY --from=builder /app/public ./public + +# Create data directory for SQLite and Config +RUN mkdir -p /app/data + +# Environment defaults +ENV NODE_ENV=production +ENV PORT=3000 + +EXPOSE 3000 + +# Start the application +CMD ["npm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7d76020 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +services: + tweets-2-bsky: + build: . + container_name: tweets-2-bsky + restart: unless-stopped + ports: + - "3000:3000" + volumes: + - ./data:/app/data + - ./config.json:/app/config.json + environment: + - TWITTER_AUTH_TOKEN=${TWITTER_AUTH_TOKEN:?} + - TWITTER_CT0=${TWITTER_CT0:?} + - TWITTER_TARGET_USERNAME=${TWITTER_TARGET_USERNAME:?} + - BLUESKY_IDENTIFIER=${BLUESKY_IDENTIFIER:? } + - BLUESKY_PASSWORD=${BLUESKY_PASSWORD:?} + - CHECK_INTERVAL_MINUTES=5 + - PORT=3000 + - JWT_SECRET=${JWT_SECRET:?} + - NODE_ENV=production + - GEMINI_API_KEY=${GEMINI_API_KEY} \ No newline at end of file -- 2.51.2