Compare commits
3 Commits
3e546fbf81
...
dc3eb4ba95
| Author | SHA1 | Date |
|---|---|---|
|
|
dc3eb4ba95 | |
|
|
045d16b0ab | |
|
|
23b607b168 |
|
|
@ -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 }}
|
||||||
|
|
@ -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"]
|
||||||
|
|
||||||
Loading…
Reference in New Issue