Skip to content

Commit

Permalink
build: add docker scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
malkiii committed Sep 1, 2024
1 parent 1071d88 commit 2b9f19f
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
dist
.env*
.git
.git
.gitignore
*.md
51 changes: 51 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish Docker image

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
REPO_NAME: ${{ github.event.repository.name }}

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_TOKEN

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
tags: $DOCKERHUB_USERNAME/$REPO_NAME:latest
push: true

release:
runs-on: ubuntu-latest
needs: publish
permissions:
contents: write

steps:
- uses: actions/checkout@v3

- name: Create a new release
run: gh release create ${{ github.ref }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 21 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
FROM node:20-slim
FROM node:20-bookworm

# Install Chrome dependencies
RUN apt-get update
RUN apt install -y \
libnss3 \
libdbus-1-3 \
libatk1.0-0 \
libgbm-dev \
libasound2 \
libxrandr2 \
libxkbcommon-dev \
libxfixes3 \
libxcomposite1 \
libxdamage1 \
libatk-bridge2.0-0 \
libcups2

# Install pnpm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

RUN corepack enable

COPY . /app
WORKDIR /app

RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile

# Install Chrome
RUN pnpm remotion:init

EXPOSE 3000

CMD ["pnpm", "start"]

0 comments on commit 2b9f19f

Please sign in to comment.