mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
fix: opt out of static site generation to enable publicRuntimeConfig
This commit is contained in:
parent
a8a56321dd
commit
239b18cdae
3 changed files with 6 additions and 26 deletions
|
@ -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
|
|
@ -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
|
|
@ -76,4 +76,9 @@ function App({ Component, pageProps }: AppProps) {
|
|||
);
|
||||
}
|
||||
|
||||
// Ops out of static site generation to use publicRuntimeConfig
|
||||
App.getInitialProps = () => {
|
||||
return {};
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
|
Loading…
Add table
Reference in a new issue