diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2a25b49 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +node_modules +.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..14afafa --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:18 + +WORKDIR /app + +RUN curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm +COPY ./pnpm-lock.yaml ./ +RUN pnpm fetch + +COPY ./ ./ +RUN pnpm install -r --offline +RUN pnpm run build + +EXPOSE 3000 +CMD ["node", "dist/server/server.js"] diff --git a/server.ts b/server.ts index 161bd70..79027e5 100644 --- a/server.ts +++ b/server.ts @@ -88,11 +88,11 @@ async function createProductionRouter() { const r = express.Router() - r.use('/', express.static('dist/client')) + r.use('/', express.static('dist/entry-client')) mountIndexHtmlRoutes(r, async (req, res) => { const transformedTemplate = await fs.readFile( - path.resolve('./dist/client/index.html'), + path.resolve('./dist/entry-client/index.html'), 'utf-8' )