Files
Dwinzo-Backend-V0.0/src/api-server/Dockerfile

32 lines
608 B
Docker

ARG NODE_VERSION=lts
FROM node:${NODE_VERSION}-alpine AS development
# Use production node environment by default.
ENV NODE_ENV=development
WORKDIR /usr/src/app
RUN npm install -g tsx --ignore-scripts
COPY package.json ./
COPY package-lock.json ./
RUN npm install --ignore-scripts && \
addgroup -S appgroup && \
adduser -S appuser -G appgroup && \
chown -R appuser:appgroup /usr/src/app
# Switch to non-root user
USER appuser
COPY . .
# Expose the port that the application listens on.
EXPOSE 3503
# Run the application.
CMD ["npm", "run", "start:api"]