Compare commits

...

3 Commits

Author SHA1 Message Date
Guillaume Dorce dc3eb4ba95 add workflow to build docker image
Build PCHL / build (push) Failing after 35s Details
2024-01-10 14:19:53 +01:00
Guillaume Dorce 045d16b0ab add Dockerfile to build astro and pocketbase
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled Details
2024-01-10 12:33:00 +01:00
Guillaume Dorce 23b607b168 test gitea actions
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m24s Details
2024-01-10 11:57:16 +01:00
2 changed files with 66 additions and 0 deletions

23
.gitea/workflows/main.yml Normal file
View File

@ -0,0 +1,23 @@
name: Build PCHL
run-name: Building pchl using astro and pocketbase
on:
push:
tags:
- 'v*.*'
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- name: Build pchl using Dockerfile
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: false
tags: pchl:${{ gitea.tag }}

43
Dockerfile Normal file
View File

@ -0,0 +1,43 @@
# PocketBase Stage
FROM alpine:latest as pocketbase
ARG PB_VERSION=0.20.5
RUN apk add --no-cache \
unzip \
ca-certificates
# download and unzip PocketBase
ADD https://github.com/pocketbase/pocketbase/releases/download/v${PB_VERSION}/pocketbase_${PB_VERSION}_linux_amd64.zip /tmp/pb.zip
RUN unzip /tmp/pb.zip -d /pb/
# Uncomment if you want to add migrations and hooks
# COPY ./pb_migrations /pb/pb_migrations
# COPY ./pb_hooks /pb/pb_hooks
EXPOSE 8080
# Node Stage
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build
# Final Stage
FROM pocketbase
# Copy built Node application to a directory in the PocketBase image
COPY --from=build /app/dist /pb/pb_public
# Start PocketBase
CMD ["/pb/pocketbase", "serve", "--http=0.0.0.0:8080"]