Skip to content

Commit cf64e85

Browse files
ildyriad7415
andauthored
Use docker to build instead (#173)
--------- Co-authored-by: Martin Stone <[email protected]>
1 parent 7e81b09 commit cf64e85

File tree

9 files changed

+101
-6
lines changed

9 files changed

+101
-6
lines changed

.github/workflows/Docker.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Docker build
2+
3+
# Run this workflow every time a new commit pushed to your repository
4+
on:
5+
push:
6+
branches:
7+
- master
8+
9+
env:
10+
PUID: '1000'
11+
PGID: '1000'
12+
13+
jobs:
14+
tests:
15+
runs-on: ubuntu-20.04
16+
name: Build
17+
steps:
18+
# Checks out a copy of your repository on the ubuntu machine
19+
- name: Checkout code
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
22+
- name: Login to GitHub Container Registry
23+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Build and push
30+
run: |
31+
docker build . --tag ghcr.io/lycheeorg/lycheeorg:latest
32+
docker push ghcr.io/lycheeorg/lycheeorg:latest

Dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FROM httpd:2.4 AS base
2+
3+
# Set version label
4+
LABEL maintainer="lycheeorg"
5+
6+
# Environment variables
7+
ENV PUID='1000'
8+
ENV PGID='1000'
9+
ENV USER='lychee'
10+
ENV PHP_TZ=UTC
11+
12+
# Multi-stage build: Build static assets
13+
# This allows us to not include Python within the final container
14+
FROM python:3.14-rc-bookworm AS python_builder
15+
16+
WORKDIR /usr/src/app
17+
18+
COPY requirements.txt ./
19+
COPY template ./template
20+
COPY utils ./utils
21+
COPY docs ./docs
22+
COPY gen.py .
23+
24+
RUN pip install --no-cache-dir -r requirements.txt && \
25+
mkdir -p dist/docs/ && \
26+
python ./gen.py
27+
28+
# Multi-stage build: Build static assets
29+
# This allows us to not include Node within the final container
30+
FROM node:20 AS node_builder
31+
32+
RUN mkdir -p /app/dist
33+
34+
WORKDIR /app
35+
36+
COPY src /app/src
37+
COPY public /app/public
38+
COPY vendor /app/vendor
39+
COPY .npmrc /app/package.json
40+
COPY astro.config.mjs /app/astro.config.mjs
41+
COPY package.json /app/package.json
42+
COPY package-lock.json /app/package-lock.json
43+
COPY tailwind.config.cjs /app/tailwind.config.cjs
44+
COPY tsconfig.json /app/tsconfig.json
45+
46+
RUN \
47+
npm ci --no-audit && \
48+
npm run build
49+
50+
FROM base
51+
COPY --from=node_builder --chown=www-data:www-data /app/dist/ /usr/local/apache2/htdocs/
52+
COPY --from=python_builder --chown=www-data:www-data /usr/src/app/dist/ /usr/local/apache2/htdocs/
53+
54+
COPY docs/css /usr/local/apache2/htdocs/docs/css
55+
COPY docs/fonts /usr/local/apache2/htdocs/docs/fonts
56+
COPY docs/img /usr/local/apache2/htdocs/docs/img
57+
COPY docs/js /usr/local/apache2/htdocs/docs/js

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# LycheeOrg.github.io
1+
# lycheeorg.dev
22

33
[![Build Status][build-status-shield]](https://github.com/LycheeOrg/LycheeOrg.github.io/actions)
44

makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ clean:
3030
docs:
3131
@echo ""
3232
@python3 gen.py
33+
34+
docker-build:
35+
docker build . -t test-lychee-docker --progress plain
36+
37+
docker-run: docker-build
38+
docker run -p 9999:80 -t test-lychee-docker

src/components/widgets/Content3.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const {
8080
>
8181
<div class="window__bar rounded-tr-lg md:pr-64">
8282
<div class="window__menuitem window__adress">
83-
LycheeOrg.github.io
83+
lycheeorg.dev
8484
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 512 512"
8585
><path
8686
d="M256 384.1c-70.7 0-128-57.3-128-128.1s57.3-128.1 128-128.1V84l96 64-96 55.7v-55.8c-59.6 0-108.1 48.5-108.1 108.1 0 59.6 48.5 108.1 108.1 108.1S364.1 316 364.1 256H384c0 71-57.3 128.1-128 128.1z"

src/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
site:
22
name: Lychee
3-
site: 'https://lycheeorg.github.io'
3+
site: 'https://lycheeorg.dev'
44
trailingSlash: false
55

66
# googleSiteVerificationId: orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M

src/navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const footerData = {
4949
{
5050
title: 'Support Lychee',
5151
links: [
52-
{ text: 'Get Lychee <span class="text-sky-500">SE</span>', href: 'https://lycheeorg.github.io/get-supporter-edition' },
52+
{ text: 'Get Lychee <span class="text-sky-500">SE</span>', href: 'https://lycheeorg.dev/get-supporter-edition' },
5353
{ text: 'GitHub sponsor', href: 'https://github.com/sponsors/LycheeOrg' },
5454
{ text: 'Open Collective', href: 'https://opencollective.com/LycheeOrg' },
5555
],

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const metadata = {
7474
>
7575
</div>
7676
<div class="window__menuitem window__adress">
77-
LycheeOrg.github.io
77+
lycheeorg.dev
7878
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 512 512"
7979
><path
8080
d="M256 384.1c-70.7 0-128-57.3-128-128.1s57.3-128.1 128-128.1V84l96 64-96 55.7v-55.8c-59.6 0-108.1 48.5-108.1 108.1 0 59.6 48.5 108.1 108.1 108.1S364.1 316 364.1 256H384c0 71-57.3 128.1-128 128.1z"

template/doc-frame.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Lychee Documentation</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
77

8-
<link rel="canonical" href="https://lycheeorg.github.io/docs/" />
8+
<link rel="canonical" href="https://lycheeorg.dev/docs/" />
99

1010
<!-- Favicon -->
1111
<link rel="icon" type="image/png" href="img/logo.png" />

0 commit comments

Comments
 (0)