Add Dockerfile
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
Dockerfile
|
||||||
|
node_modules
|
||||||
|
.git
|
||||||
+14
@@ -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'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user