Initialize deploy/docker-compose
This commit is contained in:
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@@ -0,0 +1,35 @@
|
||||
FROM node:lts-slim AS base
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
# Files required by npm install
|
||||
COPY package*.json ./
|
||||
|
||||
# Install app dependencies
|
||||
RUN npm ci
|
||||
|
||||
# Bundle app source
|
||||
COPY . .
|
||||
|
||||
# Type check app
|
||||
RUN npm run typecheck
|
||||
|
||||
FROM base AS runner
|
||||
|
||||
# Files required by npm install
|
||||
COPY package*.json ./
|
||||
|
||||
# Install only production app dependencies
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
# Bundle app source
|
||||
COPY . .
|
||||
|
||||
USER node
|
||||
|
||||
# Start the app
|
||||
EXPOSE 80
|
||||
CMD ["node", "--import", "tsx", "./src/main.ts"]
|
||||
Reference in New Issue
Block a user