diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..9189000 --- /dev/null +++ b/build.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -e + +REGISTRY="gitea.honeyy.duckdns.org" +OWNER="docker" +TAG="${1:-latest}" + +FRONTEND_IMAGE="${REGISTRY}/${OWNER}/inknote-web:${TAG}" +BACKEND_IMAGE="${REGISTRY}/${OWNER}/inknote-server:${TAG}" + +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " InkNote — Build & Push to Gitea" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "" +echo " Frontend: ${FRONTEND_IMAGE}" +echo " Backend: ${BACKEND_IMAGE}" +echo "" + +echo "→ Logging in to ${REGISTRY}..." +docker login "${REGISTRY}" + +echo "" +echo "→ Building backend..." +docker build -t "${BACKEND_IMAGE}" ./backend + +echo "" +echo "→ Building frontend..." +docker build -t "${FRONTEND_IMAGE}" ./frontend + +echo "" +echo "→ Pushing backend..." +docker push "${BACKEND_IMAGE}" + +echo "" +echo "→ Pushing frontend..." +docker push "${FRONTEND_IMAGE}" + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo " ✅ Done! Both images pushed to:" +echo " ${FRONTEND_IMAGE}" +echo " ${BACKEND_IMAGE}" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" diff --git a/frontend/dockerfile b/frontend/dockerfile index 79cab84..8af3d66 100644 --- a/frontend/dockerfile +++ b/frontend/dockerfile @@ -1,12 +1,10 @@ -# Stage 1: Build FROM node:20-alpine AS build WORKDIR /app -COPY package.json package-lock.json* ./ +COPY package.json ./ RUN npm install COPY . . RUN npm run build -# Stage 2: Serve with nginx FROM nginx:alpine COPY --from=build /app/dist /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..beb6e3b --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,15 @@ + + +
+ + + +