18 lines
899 B
Docker
18 lines
899 B
Docker
FROM node:18-alpine as builder
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
FROM node:18-alpine
|
|
WORKDIR /app
|
|
COPY --from=builder /app/build /app/build
|
|
COPY --from=builder /app/package.json /app/package.json
|
|
RUN npm install --omit=dev
|
|
RUN mkdir -p /app/certs/
|
|
EXPOSE 3000
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3000
|
|
ENV ORIGIN=https://localhost:3000
|
|
CMD ["node", "-e", "import('https').then(https => { import('fs').then(fs => { import('path').then(path => { import('./build/handler.js').then(mod => { const handler = mod.handler; const options = { key: fs.readFileSync(path.resolve('/app/certs/frontend-key.pem')), cert: fs.readFileSync(path.resolve('/app/certs/frontend-cert.pem')) }; const server = https.createServer(options, handler); server.listen(3000, () => { console.log('SvelteKit application running on https://localhost:3000'); }); }); }); }); });"] |