Skip to content

Commit

Permalink
more dockerfile optimizations and fix fastify host
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcwebdev committed Jan 2, 2025
1 parent 47bb94a commit a2db523
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,18 @@ RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp \
RUN npm install -g tsx

# Install whisper.cpp and download models
RUN git clone https://github.com/ggerganov/whisper.cpp.git && \
RUN git clone --depth=1 https://github.com/ggerganov/whisper.cpp.git && \
cd whisper.cpp && \
cmake -B build && \
cmake --build build -j --config Release && \
# ./models/download-ggml-model.sh large-v3-turbo && \
./models/download-ggml-model.sh large-v3-turbo && \
./models/download-ggml-model.sh base && \
./models/download-ggml-model.sh tiny
./models/download-ggml-model.sh tiny && \
rm -rf .git

# Copy package files and install deps
COPY package*.json ./
RUN npm ci
RUN npm ci --production && npm cache clean --force

# Copy source code
COPY src ./src
Expand All @@ -53,7 +54,6 @@ WORKDIR /root/.ollama
RUN ollama serve & \
sleep 10 && \
ollama pull llama3.2:1b && \
# ollama pull llama3.2:3b && \
pkill ollama

# ---------------------------------------------------
Expand All @@ -69,6 +69,12 @@ COPY --from=ollama /root/.ollama /root/.ollama
# Create content directory
RUN mkdir -p content

# Set proper permissions
# RUN chown -R node:node /usr/src/app

# Use non-root user
# USER node

EXPOSE 3000
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]
CMD ["--help"]
2 changes: 1 addition & 1 deletion src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function start() {
// Start the server
await fastify.listen({
port, // Use configured port
host: '0.0.0.0', // Listen on all network interfaces
host: '::', // Listen on all network interfaces
})

// Log successful server start
Expand Down

0 comments on commit a2db523

Please sign in to comment.