forked from actualbudget/actual-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the :edge images to use the very latest web UI version (actual…
…budget#121) - The `:edge` and `:edge-alpine` containers will now download the latest commit of the frontend repo and build it when they are built. - The backend dependency install process now uses the local copy of Yarn (from actualbudget#56) to install dependencies - Extraneous files are no longer copied into the production image. This is mostly a win for local builds (where the `.yarn` cache folder used to get copied in) but it’s also a small win for CI-built containers which will no longer have the README/configuration files/Yarn source code lying around - The dockerfiles now say `EXPOSE 5006`. This doesn’t have an effect on anything by default as far as I can tell but it does mean that tools know we will be listening on that port and can help users set up their container accordingly (for example, Docker Desktop) - Remove some extraneous dependencies from the containers (including openssl) --------- Co-authored-by: Trevor Farlow <[email protected]>
- Loading branch information
Showing
16 changed files
with
229 additions
and
57 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 |
---|---|---|
@@ -1,3 +1,12 @@ | ||
node_modules | ||
user-files | ||
server-files | ||
|
||
# Yarn | ||
.pnp.* | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions |
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,82 @@ | ||
name: Build Edge Docker Image | ||
|
||
# Edge Docker images are built for every commit, and daily | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- README.md | ||
- LICENSE.txt | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
env: | ||
IMAGES: | | ||
jlongster/actual-server | ||
ghcr.io/actualbudget/actual-server | ||
# Creates the following tags: | ||
# - actual-server:edge | ||
TAGS: | | ||
type=edge,value=edge | ||
jobs: | ||
build: | ||
name: Build Docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
# Push to both Docker Hub and Github Container Registry | ||
images: ${{ env.IMAGES }} | ||
tags: ${{ env.TAGS }} | ||
|
||
- name: Docker meta for Alpine image | ||
id: alpine-meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.IMAGES }} | ||
flavor: suffix=-alpine | ||
tags: $${{ env.TAGS }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push standard image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
file: docker/edge-ubuntu.Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
|
||
- name: Build and push Alpine image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
file: docker/edge-alpine.Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.alpine-meta.outputs.tags }} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | ||
spec: '@yarnpkg/plugin-workspace-tools' | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.1.cjs |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
docker/stable-ubuntu.Dockerfile |
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
FROM alpine:3.17 as base | ||
RUN apk add --no-cache nodejs yarn npm python3 openssl build-base | ||
WORKDIR /app | ||
ADD .yarn ./.yarn | ||
ADD yarn.lock package.json .yarnrc.yml ./ | ||
RUN yarn workspaces focus --all --production | ||
|
||
# Since we’re just using static files, use the Ubuntu image to build the frontend | ||
# (otherwise electron fails to build) | ||
FROM node:16-bullseye as frontend | ||
WORKDIR /frontend | ||
# Rebuild whenever there are new commits to the frontend | ||
ADD "https://api.github.com/repos/actualbudget/actual/commits" /tmp/actual-commit.json | ||
RUN git clone --depth=1 https://github.com/actualbudget/actual /frontend | ||
RUN yarn install | ||
RUN ./bin/package-browser | ||
|
||
FROM alpine:3.17 as prod | ||
RUN apk add --no-cache nodejs tini | ||
WORKDIR /app | ||
COPY --from=base /app/node_modules /app/node_modules | ||
COPY --from=frontend /frontend/packages/desktop-client/build /public | ||
ADD package.json app.js ./ | ||
ADD src ./src | ||
ENTRYPOINT ["/sbin/tini","-g", "--"] | ||
ENV ACTUAL_WEB_ROOT=/public | ||
EXPOSE 5006 | ||
CMD ["node", "app.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM node:16-bullseye as base | ||
RUN apt-get update && apt-get install -y openssl | ||
WORKDIR /app | ||
ADD .yarn ./.yarn | ||
ADD yarn.lock package.json .yarnrc.yml ./ | ||
RUN yarn workspaces focus --all --production | ||
|
||
FROM node:16-bullseye as frontend | ||
WORKDIR /frontend | ||
# Rebuild whenever there are new commits to the frontend | ||
ADD "https://api.github.com/repos/actualbudget/actual/commits" /tmp/actual-commit.json | ||
RUN git clone --depth=1 https://github.com/actualbudget/actual /frontend | ||
RUN yarn install | ||
RUN ./bin/package-browser | ||
|
||
FROM node:16-bullseye-slim as prod | ||
RUN apt-get update && apt-get install tini && apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
WORKDIR /app | ||
COPY --from=base /app/node_modules /app/node_modules | ||
COPY --from=frontend /frontend/packages/desktop-client/build /public | ||
ADD package.json app.js ./ | ||
ADD src ./src | ||
ENTRYPOINT ["/usr/bin/tini","-g", "--"] | ||
ENV ACTUAL_WEB_ROOT=/public | ||
EXPOSE 5006 | ||
CMD ["node", "app.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM alpine:3.17 as base | ||
RUN apk add --no-cache nodejs yarn npm python3 openssl build-base | ||
WORKDIR /app | ||
ADD .yarn ./.yarn | ||
ADD yarn.lock package.json .yarnrc.yml ./ | ||
RUN yarn workspaces focus --all --production | ||
|
||
FROM alpine:3.17 as prod | ||
RUN apk add --no-cache nodejs tini | ||
WORKDIR /app | ||
COPY --from=base /app/node_modules /app/node_modules | ||
ADD package.json app.js ./ | ||
ADD src ./src | ||
ENTRYPOINT ["/sbin/tini","-g", "--"] | ||
EXPOSE 5006 | ||
CMD ["node", "app.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM node:16-bullseye as base | ||
RUN apt-get update && apt-get install -y openssl | ||
WORKDIR /app | ||
ADD .yarn ./.yarn | ||
ADD yarn.lock package.json .yarnrc.yml ./ | ||
RUN yarn workspaces focus --all --production | ||
|
||
FROM node:16-bullseye-slim as prod | ||
RUN apt-get update && apt-get install tini && apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
WORKDIR /app | ||
COPY --from=base /app/node_modules /app/node_modules | ||
ADD package.json app.js ./ | ||
ADD src ./src | ||
ENTRYPOINT ["/usr/bin/tini","-g", "--"] | ||
EXPOSE 5006 | ||
CMD ["node", "app.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
File renamed without changes.
File renamed without changes.
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