1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

add standalone build

This commit is contained in:
Fedor Katurov 2025-03-24 17:42:00 +07:00
parent f083b488ba
commit 1e26f7ec62
5 changed files with 56 additions and 4 deletions

View file

@ -2,6 +2,8 @@
node_modules node_modules
out out
dist dist
.husky
.next
.idea .idea
.history .history
.vscode .vscode

View file

@ -2,7 +2,7 @@ name: Build & Publish
on: on:
push: push:
branches: [master] branches: [standalone]
jobs: jobs:
push_to_registry: push_to_registry:

View file

@ -0,0 +1,49 @@
# Base ───────────────────────────────────────────────────────────────────────
FROM node:14-alpine as base
WORKDIR /opt/app
ENV PATH /opt/app/node_modules/.bin:$PATH
# Build ──────────────────────────────────────────────────────────────────────
FROM base as builder
ARG NEXT_PUBLIC_API_HOST
ARG NEXT_PUBLIC_REMOTE_CURRENT
ARG NEXT_PUBLIC_PUBLIC_HOST
ARG NEXT_PUBLIC_BOT_USERNAME
ENV NEXT_PUBLIC_API_HOST $NEXT_PUBLIC_API_HOST
ENV NEXT_PUBLIC_REMOTE_CURRENT $NEXT_PUBLIC_REMOTE_CURRENT
ENV NEXT_PUBLIC_PUBLIC_HOST $NEXT_PUBLIC_PUBLIC_HOST
ENV NEXT_PUBLIC_BOT_USERNAME $NEXT_PUBLIC_BOT_USERNAME
# ENV NEXT_PUBLIC_API_HOST https://vault48.org/api/
# ENV NEXT_PUBLIC_REMOTE_CURRENT https://vault48.org/static/
# ENV NEXT_PUBLIC_PUBLIC_HOST https://vault48.org/
# ENV NEXT_PUBLIC_BOT_USERNAME vault48bot
COPY package.json .
COPY yarn.lock .
RUN true \
&& yarn install --frozen-lockfile\
&& yarn global add pkg \
&& true
COPY . /opt/app
# pkg packs nodejs with given script, so we don't need it in next section
RUN true \
&& yarn next build \
&& true
FROM node:14-alpine as runner
COPY --from=builder /opt/app/public ./public
COPY --from=builder /opt/app/.next/standalone .
COPY --from=builder /opt/app/.next/static ./.next/static
EXPOSE 3000
ENTRYPOINT ["node", "server.js"]

View file

@ -9,6 +9,7 @@ const withTM = require('next-transpile-modules')([
module.exports = withBundleAnalyzer( module.exports = withBundleAnalyzer(
withTM({ withTM({
output: 'standalone',
/** rewrite old-style node paths */ /** rewrite old-style node paths */
async rewrites() { async rewrites() {
return [ return [

View file

@ -803,9 +803,9 @@ callsites@^3.0.0:
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
caniuse-lite@^1.0.30001332: caniuse-lite@^1.0.30001332:
version "1.0.30001564" version "1.0.30001707"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz" resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001707.tgz"
integrity sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg== integrity sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw==
chalk@^2.0.0: chalk@^2.0.0:
version "2.4.2" version "2.4.2"