Skip to content

Commit

Permalink
Fix arm build (m1k1o#302)
Browse files Browse the repository at this point in the history
* WIP.

* WIP.

* WIP.
  • Loading branch information
m1k1o authored Apr 29, 2023
1 parent 92ad202 commit 5959d05
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 17 deletions.
38 changes: 21 additions & 17 deletions .docker/base/Dockerfile.arm
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,27 @@ RUN ./build
#
# STAGE 2: CLIENT
#
FROM node:18-bullseye-slim as client

# install dependencies
RUN set -eux; apt-get update; \
apt-get install -y --no-install-recommends python2 build-essential

WORKDIR /src

#
# install dependencies
COPY client/package*.json ./
RUN npm install

# Because client builds fail in Github Actions, therefor we build it outside of Docker.
#
# FROM node:18-bullseye-slim as client
#
# # install dependencies
# RUN set -eux; apt-get update; \
# apt-get install -y --no-install-recommends python2 build-essential
#
# WORKDIR /src
#
# #
# # install dependencies
# COPY client/package*.json ./
# RUN npm install
#
# #
# # build client
# COPY client/ .
# RUN npm run build
#
# build client
COPY client/ .
RUN npm run build

#
# STAGE 3: RUNTIME
#
Expand Down Expand Up @@ -134,7 +137,8 @@ ENV NEKO_BIND=:8080
#
# copy static files from previous stages
COPY --from=server /src/bin/neko /usr/bin/neko
COPY --from=client /src/dist/ /var/www
# COPY --from=client /src/dist/ /var/www
COPY client/dist/ /var/www

HEALTHCHECK --interval=10s --timeout=5s --retries=8 \
CMD wget -O - http://localhost:${NEKO_BIND#*:}/health || exit 1
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/ghcr-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,51 @@ env:
PLATFORMS: linux/arm64,linux/arm/v7

jobs:
build-client:
runs-on: ubuntu-latest
#
# do not run on forks
#
if: github.repository_owner == 'm1k1o'
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18.x
-
name: Build client
run: |
cd client
npm install
npm run build
-
name: Upload client dist
uses: actions/upload-artifact@v3
with:
name: client-dist
path: client/dist

build-base:
runs-on: ubuntu-latest
#
# do not run on forks
#
if: github.repository_owner == 'm1k1o'
needs: [ build-client ]
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Download client dist
uses: actions/download-artifact@v3
with:
name: client-dist
path: client/dist
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down

0 comments on commit 5959d05

Please sign in to comment.