This commit is contained in:
Lee 2023-01-14 14:27:22 +00:00
commit c1eeb2e837
6 changed files with 456 additions and 6429 deletions

@ -1,12 +1,14 @@
docker-build: # cache:
# Official docker image. # key: ${CI_COMMIT_REF_SLUG}
# paths:
# - workdir/
# for later?
publish:
image: docker:latest image: docker:latest
stage: build stage: build
variables: variables:
DOCKER_DRIVER: overlay DOCKER_DRIVER: overlay
services:
- docker:dind
before_script: before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script: script:
@ -14,3 +16,17 @@ docker-build:
- docker push "$CI_REGISTRY_IMAGE" - docker push "$CI_REGISTRY_IMAGE"
only: only:
- main - main
deploy:
image: alpine:latest
stage: deploy
tags:
script:
- chmod og= $ID_RSA
- apk update && apk add openssh-client
- ssh -i $ID_RSA -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP "cd /home/overlay && docker compose pull && docker compose up -d && docker image prune -f"
environment:
name: production
url: https://bs-overlay.fascinated.cc
only:
- main

@ -1,6 +0,0 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: daily

@ -1,7 +1,7 @@
# Install dependencies only when needed # Install dependencies only when needed
FROM node:19-alpine AS deps FROM node:19 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add libc6-compat #RUN apk add libc6-compat
WORKDIR /app WORKDIR /app
# Install dependencies based on the preferred package manager # Install dependencies based on the preferred package manager
@ -10,24 +10,21 @@ COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
# Copy cached files # Copy cached files
#COPY node_modules ./ #COPY node_modules ./
RUN npm i #RUN npm i
# RUN \ RUN \
# if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
# elif [ -f package-lock.json ]; then npm ci; \ elif [ -f package-lock.json ]; then npm ci; \
# elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \ elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
# else echo "Lockfile not found." && exit 1; \ else echo "Lockfile not found." && exit 1; \
# fi fi
# Rebuild the source code only when needed # Rebuild the source code only when needed
FROM node:19-alpine AS builder FROM node:19 AS builder
WORKDIR /app WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
# Build the project # Build the project
@ -38,7 +35,6 @@ FROM node:19-alpine AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV production ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup -g 1001 -S nodejs RUN addgroup -g 1001 -S nodejs
@ -53,7 +49,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./.next/static COPY --from=builder --chown=nextjs:nodejs /app/public ./.next/static
RUN npm i @beam-australia/react-env RUN npm i -g @beam-australia/react-env
RUN chown -R nextjs:nodejs /app RUN chown -R nextjs:nodejs /app

6807
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -33,7 +33,7 @@
"@types/react": "^18.0.26", "@types/react": "^18.0.26",
"@types/websocket": "^1.0.5", "@types/websocket": "^1.0.5",
"eslint": "8.31.0", "eslint": "8.31.0",
"eslint-config-next": "13.1.1", "eslint-config-next": "13.1.2",
"typescript": "^4.9.4" "typescript": "^4.9.4"
} }
} }

@ -180,10 +180,10 @@
resolved "https://registry.npmjs.org/@next/env/-/env-13.1.1.tgz" resolved "https://registry.npmjs.org/@next/env/-/env-13.1.1.tgz"
integrity sha512-vFMyXtPjSAiOXOywMojxfKIqE3VWN5RCAx+tT3AS3pcKjMLFTCJFUWsKv8hC+87Z1F4W3r68qTwDFZIFmd5Xkw== integrity sha512-vFMyXtPjSAiOXOywMojxfKIqE3VWN5RCAx+tT3AS3pcKjMLFTCJFUWsKv8hC+87Z1F4W3r68qTwDFZIFmd5Xkw==
"@next/eslint-plugin-next@13.1.1": "@next/eslint-plugin-next@13.1.2":
version "13.1.1" version "13.1.2"
resolved "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-13.1.1.tgz" resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-13.1.2.tgz#613deefddc9a2f3a3ef01a100cbcff54dfa03fd0"
integrity sha512-SBrOFS8PC3nQ5aeZmawJkjKkWjwK9RoxvBSv/86nZp0ubdoVQoko8r8htALd9ufp16NhacCdqhu9bzZLDWtALQ== integrity sha512-WGaNVvIYphdriesP6r7jq/8l7u38tzotnVQuxc1RYKLqYYApSsrebti3OCPoT3Gx0pw2smPIFHH98RzcsgW5GQ==
dependencies: dependencies:
glob "7.1.7" glob "7.1.7"
@ -1546,12 +1546,12 @@ escape-string-regexp@^4.0.0:
resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz"
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
eslint-config-next@13.1.1: eslint-config-next@13.1.2:
version "13.1.1" version "13.1.2"
resolved "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-13.1.1.tgz" resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-13.1.2.tgz#bd15be592546e3543f77f96bc55be830dd76fd41"
integrity sha512-/5S2XGWlGaiqrRhzpn51ux5JUSLwx8PVK2keLi5xk7QmhfYB8PqE6R6SlVw6hgnf/VexvUXSrlNJ/su00NhtHQ== integrity sha512-zdRAQOr8v69ZwJRtBrGqAqm160ONqKxU/pV1FB1KlgfyqveGsLZmlQ7l31otwtw763901J7xdiTVkj2y3YxXZA==
dependencies: dependencies:
"@next/eslint-plugin-next" "13.1.1" "@next/eslint-plugin-next" "13.1.2"
"@rushstack/eslint-patch" "^1.1.3" "@rushstack/eslint-patch" "^1.1.3"
"@typescript-eslint/parser" "^5.42.0" "@typescript-eslint/parser" "^5.42.0"
eslint-import-resolver-node "^0.3.6" eslint-import-resolver-node "^0.3.6"