-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--------- Co-authored-by: Martin Stone <[email protected]>
- Loading branch information
Showing
9 changed files
with
101 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Docker build | ||
|
||
# Run this workflow every time a new commit pushed to your repository | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
PUID: '1000' | ||
PGID: '1000' | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-20.04 | ||
name: Build | ||
steps: | ||
# Checks out a copy of your repository on the ubuntu machine | ||
- name: Checkout code | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
run: | | ||
docker build . --tag ghcr.io/lycheeorg/lycheeorg:latest | ||
docker push ghcr.io/lycheeorg/lycheeorg:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
FROM httpd:2.4 AS base | ||
|
||
# Set version label | ||
LABEL maintainer="lycheeorg" | ||
|
||
# Environment variables | ||
ENV PUID='1000' | ||
ENV PGID='1000' | ||
ENV USER='lychee' | ||
ENV PHP_TZ=UTC | ||
|
||
# Multi-stage build: Build static assets | ||
# This allows us to not include Python within the final container | ||
FROM python:3.14-rc-bookworm AS python_builder | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY requirements.txt ./ | ||
COPY template ./template | ||
COPY utils ./utils | ||
COPY docs ./docs | ||
COPY gen.py . | ||
|
||
RUN pip install --no-cache-dir -r requirements.txt && \ | ||
mkdir -p dist/docs/ && \ | ||
python ./gen.py | ||
|
||
# Multi-stage build: Build static assets | ||
# This allows us to not include Node within the final container | ||
FROM node:20 AS node_builder | ||
|
||
RUN mkdir -p /app/dist | ||
|
||
WORKDIR /app | ||
|
||
COPY src /app/src | ||
COPY public /app/public | ||
COPY vendor /app/vendor | ||
COPY .npmrc /app/package.json | ||
COPY astro.config.mjs /app/astro.config.mjs | ||
COPY package.json /app/package.json | ||
COPY package-lock.json /app/package-lock.json | ||
COPY tailwind.config.cjs /app/tailwind.config.cjs | ||
COPY tsconfig.json /app/tsconfig.json | ||
|
||
RUN \ | ||
npm ci --no-audit && \ | ||
npm run build | ||
|
||
FROM base | ||
COPY --from=node_builder --chown=www-data:www-data /app/dist/ /usr/local/apache2/htdocs/ | ||
COPY --from=python_builder --chown=www-data:www-data /usr/src/app/dist/ /usr/local/apache2/htdocs/ | ||
|
||
COPY docs/css /usr/local/apache2/htdocs/docs/css | ||
COPY docs/fonts /usr/local/apache2/htdocs/docs/fonts | ||
COPY docs/img /usr/local/apache2/htdocs/docs/img | ||
COPY docs/js /usr/local/apache2/htdocs/docs/js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters