Updates to the frontend

This commit is contained in:
Braydon 2024-04-16 20:22:57 -04:00
parent c7d0f31852
commit 0216662767
3 changed files with 101 additions and 0 deletions

@ -0,0 +1,30 @@
name: Deploy Frontend
on:
push:
branches: ["master"]
paths: [".gitea/workflows/deploy-frontend.yml", "Frontend/**"]
jobs:
docker:
strategy:
matrix:
java-version: ["17"]
maven-version: ["3.8.5"]
runs-on: "ubuntu-latest"
defaults:
run:
working-directory: "./Frontend"
# Steps to run
steps:
# Checkout the repo
- name: Checkout
uses: actions/checkout@v4
# Deploy to Dokku
- name: Deploy to Dokku
uses: dokku/github-action@master
with:
git_remote_url: "ssh://dokku@10.10.3.28:22/restfulmc-web"
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}

26
Frontend/.dockerignore Normal file

@ -0,0 +1,26 @@
**/.classpath
**/.dockerignore
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/.gitea
**/.next
**/.env
LICENSE
README.md

45
Frontend/Dockerfile Normal file

@ -0,0 +1,45 @@
FROM fascinated/docker-images:nodejs_20_with_yarn AS base
# Install dependencies
FROM base AS depends
WORKDIR /usr/src/app
COPY package.json* yarn.lock* ./
RUN yarn install --frozen-lockfile --quiet
# Build the app
FROM base AS builder
WORKDIR /usr/src/app
COPY --from=depends /usr/src/app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED 1
RUN yarn run build
# Run the app
FROM base AS runner
WORKDIR /usr/src/app
RUN addgroup --system --gid 1001 nextjs
RUN adduser --system --uid 1001 nextjs
RUN mkdir .next
RUN chown nextjs:nextjs .next
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/.next ./.next
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/public ./public
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/next.config.mjs ./next.config.mjs
COPY --from=builder --chown=nextjs:nextjs /usr/src/app/package.json ./package.json
ENV NODE_ENV production
# Exposting on port 80 so we can
# access via a reverse proxy for Dokku
ENV HOSTNAME "0.0.0.0"
EXPOSE 80
ENV PORT 80
USER nextjs
CMD ["yarn", "start"]