Skip to content

Commit

Permalink
remove env req
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcwebdev committed Dec 27, 2024
1 parent affb71e commit 254c351
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 38 deletions.
24 changes: 10 additions & 14 deletions Dockerfile → .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Dockerfile
# .github/Dockerfile

# ---------------------------------------------------
# 1) Node base image with your usual packages
Expand All @@ -23,41 +23,37 @@ RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp \
-o /usr/local/bin/yt-dlp && \
chmod a+rx /usr/local/bin/yt-dlp

# Install tsx globally
RUN npm install -g tsx

# Copy only package.json and package-lock.json to install dependencies
# Copy package.json and package-lock.json from build context (..)
# (Because of "context: .." in docker-compose.yml)
COPY package*.json ./

# Install Node.js dependencies
RUN npm ci

# Copy the application source code (excluding files specified in .dockerignore)
# Copy source code
COPY src ./src
COPY docker-entrypoint.sh ./

# Ensure the entrypoint script is executable
# Copy entrypoint script from .github directory
COPY .github/docker-entrypoint.sh ./
RUN chmod +x /usr/src/app/docker-entrypoint.sh

# ---------------------------------------------------
# 2) Pull the official Ollama image to copy out `ollama`
# ---------------------------------------------------
FROM ollama/ollama:latest AS ollama-stage
# The official image puts the `ollama` binary in /bin/ollama (Alpine-based),
# or /usr/local/bin/ollama (Debian-based). We'll see which is correct.
# The official image might have /bin/ollama or /usr/local/bin/ollama

# ---------------------------------------------------
# 3) Final stage: combine everything
# ---------------------------------------------------
FROM base

# COPY from the Ollama stage to your final image:
# (Check *which* path works for your version of the image)
# (Check which path works for your version of the image)
COPY --from=ollama-stage /bin/ollama /usr/local/bin/ollama
# or if that fails, try:
# If that fails, try:
# COPY --from=ollama-stage /usr/local/bin/ollama /usr/local/bin/ollama

COPY .env .env

ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
CMD ["--help"]
CMD ["--help"]
16 changes: 16 additions & 0 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# docker-compose.yml

version: '3.8'

services:
autoshow:
# Use the parent directory (..) as the Docker build context
build:
context: ..
dockerfile: .github/Dockerfile
# Mount directories/files from host to container
volumes:
- ../content:/usr/src/app/content
- ../.env:/usr/src/app/.env
stdin_open: true
tty: true
6 changes: 6 additions & 0 deletions .github/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
# .github/docker-entrypoint.sh

# Run the autoshow command with all arguments passed to the container
# exec tsx --env-file=.env --no-warnings --experimental-sqlite src/cli/commander.ts "$@"
exec tsx --no-warnings --experimental-sqlite src/cli/commander.ts "$@"
19 changes: 0 additions & 19 deletions docker-compose.yml

This file was deleted.

5 changes: 0 additions & 5 deletions docker-entrypoint.sh

This file was deleted.

0 comments on commit 254c351

Please sign in to comment.