docker-compose and actions
All checks were successful
Build and Push Docker Image / build (push) Successful in 26s
All checks were successful
Build and Push Docker Image / build (push) Successful in 26s
This commit is contained in:
33
.gitea/workflows/docker-build.yaml
Normal file
33
.gitea/workflows/docker-build.yaml
Normal file
@@ -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 }}
|
||||||
12
Dockerfile
12
Dockerfile
@@ -9,12 +9,10 @@ WORKDIR /app
|
|||||||
COPY resume.json .
|
COPY resume.json .
|
||||||
|
|
||||||
# Install theme and generate HTML using its built-in CLI
|
# 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
|
# Serve with nginx
|
||||||
FROM alpine:latest
|
FROM nginx:alpine
|
||||||
WORKDIR /output
|
COPY --from=builder /app/www /usr/share/nginx/html
|
||||||
COPY --from=builder /app/resume.html .
|
|
||||||
|
|
||||||
# Default command outputs HTML to stdout
|
EXPOSE 80
|
||||||
CMD ["cat", "resume.html"]
|
|
||||||
|
|||||||
5
docker-compose.yaml
Normal file
5
docker-compose.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
services:
|
||||||
|
resume:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
Reference in New Issue
Block a user