From fab9318d8454d62f24ac723c952fde7ed94697a0 Mon Sep 17 00:00:00 2001 From: Phillip Tarrant Date: Mon, 8 Dec 2025 11:58:38 -0600 Subject: [PATCH] docker-compose and actions --- .gitea/workflows/docker-build.yaml | 33 ++++++++++++++++++++++++++++++ Dockerfile | 12 +++++------ docker-compose.yaml | 5 +++++ 3 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 .gitea/workflows/docker-build.yaml create mode 100644 docker-compose.yaml diff --git a/.gitea/workflows/docker-build.yaml b/.gitea/workflows/docker-build.yaml new file mode 100644 index 0000000..b15e80f --- /dev/null +++ b/.gitea/workflows/docker-build.yaml @@ -0,0 +1,33 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + # required to ensure we have node and all the build requirements for gitea actions + container: docker.io/catthehacker/ubuntu:act-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: git.sneakygeek.net + username: ${{ github.actor }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + git.sneakygeek.net/sneakygeek/resume:latest + git.sneakygeek.net/sneakygeek/resume:${{ github.sha }} diff --git a/Dockerfile b/Dockerfile index 01c1eae..30fd982 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,12 +9,10 @@ WORKDIR /app COPY resume.json . # Install theme and generate HTML using its built-in CLI -RUN npx jsonresume-theme-even < resume.json > resume.html +RUN mkdir -p www && npx jsonresume-theme-even < resume.json > www/index.html -# Final minimal image with just the HTML -FROM alpine:latest -WORKDIR /output -COPY --from=builder /app/resume.html . +# Serve with nginx +FROM nginx:alpine +COPY --from=builder /app/www /usr/share/nginx/html -# Default command outputs HTML to stdout -CMD ["cat", "resume.html"] +EXPOSE 80 diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..59c93f6 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,5 @@ +services: + resume: + build: . + ports: + - "8080:80"