Skip to content

Instantly share code, notes, and snippets.

@travisdmathis
Created October 17, 2024 15:35
Show Gist options
  • Save travisdmathis/1d19cbb072ca6059fa534acfc4ca180a to your computer and use it in GitHub Desktop.
Save travisdmathis/1d19cbb072ca6059fa534acfc4ca180a to your computer and use it in GitHub Desktop.
Svelte 5/SvelteKit + FFMPEG
# Base stage for shared dependencies
FROM ubuntu:20.04 AS base
# Avoid prompts from apt
ENV DEBIAN_FRONTEND=noninteractive
# Install Node.js, FFmpeg, and other dependencies
RUN apt-get update && apt-get install -y \
curl \
gnupg \
ffmpeg \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Build stage
FROM base AS build
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install all dependencies
RUN npm ci
# Copy the rest of the application code
COPY . .
# Build the application
RUN npm run build
# Production stage
FROM base AS production
WORKDIR /app
# Copy built assets from build stage
COPY --from=build /app/build build/
COPY --from=build /app/package.json .
COPY --from=build /app/package-lock.json .
# Install production dependencies
RUN npm ci --omit=dev
# Expose the port the app runs on
EXPOSE 3000
# Start the application
CMD ["node", "build"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment