From edd75a7127c525494f67ec845c74c149fa3ebf48 Mon Sep 17 00:00:00 2001 From: devaine Date: Mon, 11 May 2026 15:04:12 -0500 Subject: [PATCH] test(dockerfile & workflow): added spacings for secrets, optimized Dockerfile --- .forgejo/workflows/start.yaml | 4 +- Dockerfile | 73 ++++++++++++++++++++--------------- start.bash | 2 +- 3 files changed, 44 insertions(+), 35 deletions(-) diff --git a/.forgejo/workflows/start.yaml b/.forgejo/workflows/start.yaml index 2f93876..b309476 100644 --- a/.forgejo/workflows/start.yaml +++ b/.forgejo/workflows/start.yaml @@ -82,10 +82,10 @@ jobs: run: | # Begin setting up SSH w/ Secrets install -m 600 -D /dev/null ~/.ssh/${{ secrets.DEPLOY_USER }} - echo "${{ secrets.DEPLOY_KEY }}" | base64 -d > ~/.ssh/${{ secrets.DEPLOY_USER }} + echo ${{ secrets.DEPLOY_KEY }} | base64 -d > ~/.ssh/${{ secrets.DEPLOY_USER }} ssh-keyscan -H -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_HOST }} > ~/.ssh/known_hosts - printf "Host deploy\nPort ${{ secrets.DEPLOY_PORT }}\nHostname ${{ secrets.DEPLOY_HOST }}\nIdentityFile ~/.ssh/${{ secrets.DEPLOY_USER }}\nUser ${{ secrets.DEPLOY_USER }}" > ~/.ssh/config + printf "Host deploy\nPort ${{ secrets.DEPLOY_PORT }} \nHostname ${{ secrets.DEPLOY_HOST }} \nIdentityFile ~/.ssh/ ${{ secrets.DEPLOY_USER }} \nUser ${{ secrets.DEPLOY_USER }}" > ~/.ssh/config unset DOCKER_HOST docker context create deploy --docker "host=ssh://deploy" docker context use deploy diff --git a/Dockerfile b/Dockerfile index 9382d9f..9f42f96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,39 +1,48 @@ -# TODO: Plan for docker-compose.yml, create a script on run.bash to wait for .env file to run -# the application +# TODO: Plans: +# Multi-stage builds, seperating building frontend & pre-requisites + +# NOTE: Frontend setup +FROM node:25-alpine AS frontend-build + +WORKDIR /app/frontend + +COPY frontend/package.json frontend/package-lock.json ./ + +ENV NEXT_TELEMETRY_DISABLED=1 + +RUN npm ci + +COPY frontend/ . + +RUN npm run build + +# NOTE: Backend setup +FROM node:25-alpine AS backend-build + +RUN apk add --no-cache python3 py3-pip + +WORKDIR /app/api + +COPY api/requirements.txt ./ + +RUN python3 -m venv --copies venv + +ENV PATH="/app/api/venv/bin:$PATH" + +RUN pip install --no-cache-dir -U -r requirements.txt + +COPY api/src src/ + + +# Actual setup FROM node:25-alpine WORKDIR /app -RUN <