1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-06-30 06:30:11 +02:00

fix: opt out of static site generation to enable publicRuntimeConfig

This commit is contained in:
Elias Schneider 2022-10-18 09:17:57 +02:00
parent a8a56321dd
commit 239b18cdae
3 changed files with 6 additions and 26 deletions

View File

@ -31,4 +31,4 @@ WORKDIR /opt/app
RUN npm i -g dotenv-cli
EXPOSE 3000
CMD cd frontend && dotenv -e .env.development node_modules/.bin/next start & cd backend && npm run prod
CMD cd frontend && dotenv node_modules/.bin/next start & cd backend && npm run prod

View File

@ -1,25 +0,0 @@
FROM node:18-alpine AS deps
WORKDIR /opt/app
FROM node:18-alpine AS builder
ENV NODE_ENV=production
WORKDIR /opt/app
COPY . .
COPY --from=deps /opt/app/node_modules ./node_modules
RUN npm run build
FROM node:18-alpine AS runner
WORKDIR /opt/app
ENV NODE_ENV=production
COPY --from=builder /opt/app/next.config.js ./
COPY --from=builder /opt/app/public ./public
COPY --from=builder /opt/app/.next ./.next
COPY --from=builder /opt/app/node_modules ./node_modules
RUN npm i -g dotenv-cli
EXPOSE 3000
CMD dotenv -e .env.development node_modules/.bin/next start

View File

@ -76,4 +76,9 @@ function App({ Component, pageProps }: AppProps) {
);
}
// Ops out of static site generation to use publicRuntimeConfig
App.getInitialProps = () => {
return {};
};
export default App;