From 17b6b521da240057c058d558253d87446352197d Mon Sep 17 00:00:00 2001 From: Simon Reinisch Date: Sun, 5 Nov 2023 18:00:20 +0100 Subject: [PATCH] chore: use busybox instead of nginx update readme --- .github/workflows/main.yml | 7 +++++++ Dockerfile | 13 ++++++------- README.md | 16 ++++++++++++---- config/nginx.conf | 10 ---------- 4 files changed, 25 insertions(+), 21 deletions(-) delete mode 100644 config/nginx.conf diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8637613..9e3eebf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,6 +67,12 @@ jobs: type=semver,pattern=v{{version}} type=semver,pattern=v{{major}}.{{minor}} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push Docker image uses: docker/build-push-action@v5 with: @@ -74,5 +80,6 @@ jobs: provenance: false tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 build-args: | OCULAR_GENESIS_HOST=${{ env.OCULAR_GENESIS_HOST }} diff --git a/Dockerfile b/Dockerfile index 5c5f920..3a67c23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM node:20-alpine AS build +FROM --platform=$BUILDPLATFORM node:20-alpine AS build ARG OCULAR_GENESIS_HOST ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" -RUN corepack enable +RUN npx pnpm install --global pnpm@8 WORKDIR /app COPY package.json pnpm-lock.yaml /app/ @@ -14,12 +14,11 @@ RUN pnpm install --frozen-lockfile COPY . /app RUN pnpm run build -FROM nginx:1.25-alpine +FROM busybox:1.36.1-musl -RUN rm /etc/nginx/conf.d/default.conf -COPY --from=build /app/dist /usr/share/nginx/html -COPY --from=build /app/config/nginx.conf /etc/nginx/conf.d +WORKDIR /home/static +COPY --from=build /app/dist /home/static EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] +CMD ["busybox", "httpd", "-v", "-f"] diff --git a/README.md b/README.md index c47cee6..6551e10 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,14 @@ src="https://github.com/Simonwep/ocular/workflows/CI/badge.svg"/>

+### Table of contents + +* [Features](#features) - _What does this app do?_ +* [Summary](#summary) - _What is this app?_ +* [Setup](#setup) - _How to set this up?_ + * [Development](#development) - _How to run this locally?_ + * [Production](#production) - _How to deploy this?_ + ### Features - 🦾 Self-hosted. @@ -38,13 +46,13 @@ The goal of the app is **not** to track individual expenses, work with multiple This app comes with its own backend (by using [genesis](https://github.com/simonwep/genesis)), so the only thing you need to do is to host it somewhere. Your data stays on your server and is not shared with anyone else. -### State of this project - I consider the current state of it as the MVP for personal use. But I'm planning on adding more [features](https://github.com/Simonwep/ocular/issues) - I'm not planning of making it any more in-depth as it already is, planned features may only include adding a way to define goals or general improvements for mobile usage. As I already said, if you're looking for an in-depth tool to manage your finances check out [firefly](https://www.firefly-iii.org/)! -### Development +### Setup + +#### Development This app uses [genesis](https://github.com/simonwep/genesis) as generic backend. Go to the [genesis](https://github.com/simonwep/genesis) repository and follow the instructions to set it up first. @@ -52,7 +60,7 @@ Go to the [genesis](https://github.com/simonwep/genesis) repository and follow t To run the frontend make sure you have the latest [node LTS](https://nodejs.org/en/) installed, as well as [pnpm](https://pnpm.io/). You can then start the frontend by running `pnpm run dev` in the root directory. -### Production +#### Production This app is deployed using [docker-compose](https://docs.docker.com/compose/). See [ocular-docker](https://github.com/simonwep/ocular-docker) for deployment. diff --git a/config/nginx.conf b/config/nginx.conf deleted file mode 100644 index 65caef6..0000000 --- a/config/nginx.conf +++ /dev/null @@ -1,10 +0,0 @@ -server { - listen 80; - server_name localhost; - - location / { - root /usr/share/nginx/html; - index index.html; - try_files $uri $uri/ /index.html; - } -}