- Fixed database URL locally and in production - Set separate DB user just to be safe - Migrate DB schema on each launch - Use node user during dev but use root during deploy - Fix output of the dev container (tsc-watch --noClear)
27 lines
602 B
Text
27 lines
602 B
Text
# Check out https://hub.docker.com/_/node to select a new base image
|
|
FROM node:16-slim
|
|
|
|
# Set to a non-root built-in user `node`
|
|
USER node
|
|
|
|
# Create app directory (with user `node`)
|
|
RUN mkdir -p /home/node/app
|
|
|
|
WORKDIR /home/node/app
|
|
|
|
# Install app dependencies
|
|
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
|
# where available (npm@5+)
|
|
COPY --chown=node package*.json ./
|
|
|
|
RUN npm install
|
|
|
|
# Bundle app source code
|
|
COPY --chown=node . .
|
|
|
|
RUN npm run build
|
|
|
|
# Bind to all network interfaces so that it can be mapped to the host OS
|
|
ENV HOST=0.0.0.0
|
|
|
|
CMD [ "node", "." ]
|