Add Dockerfile

pull/1/head
Francesco Minnocci 2 years ago
parent 28a1a85531
commit ce66efe4a8
Signed by: BachoSeven
GPG Key ID: 2BE4AB7FDAD828A4

@ -0,0 +1,3 @@
Dockerfile
node_modules
.git

@ -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"]

@ -88,11 +88,11 @@ async function createProductionRouter() {
const r = express.Router() const r = express.Router()
r.use('/', express.static('dist/client')) r.use('/', express.static('dist/entry-client'))
mountIndexHtmlRoutes(r, async (req, res) => { mountIndexHtmlRoutes(r, async (req, res) => {
const transformedTemplate = await fs.readFile( const transformedTemplate = await fs.readFile(
path.resolve('./dist/client/index.html'), path.resolve('./dist/entry-client/index.html'),
'utf-8' 'utf-8'
) )

Loading…
Cancel
Save