mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 13:49:40 +00:00
feat:mvp1 initial commit
This commit is contained in:
33
Dockerfile.local
Normal file
33
Dockerfile.local
Normal file
@ -0,0 +1,33 @@
|
||||
# Base image
|
||||
FROM node:22.4.1-alpine
|
||||
RUN apk update && \
|
||||
apk upgrade && \
|
||||
apk add ca-certificates curl && \
|
||||
update-ca-certificates
|
||||
|
||||
#saudi timezone
|
||||
ENV TZ=Asia/Riyadh
|
||||
|
||||
# Create app directory
|
||||
RUN mkdir /app && chown node:node /app
|
||||
WORKDIR /app
|
||||
|
||||
# finally switch user to node
|
||||
USER node
|
||||
|
||||
|
||||
# A wildcard is used to ensure both package.json, package-lock.json and package-lock.json are copied
|
||||
COPY --chown=node:node package*.json ./
|
||||
|
||||
|
||||
|
||||
# Install app dependencies
|
||||
RUN npm install --frozen-lockfile
|
||||
# Bundle app source
|
||||
COPY --chown=node:node . .
|
||||
|
||||
# Creates a "dist" folder with the production build
|
||||
RUN npm run build
|
||||
|
||||
# Start the server using the production build
|
||||
CMD [ "node", "dist/main" ]
|
Reference in New Issue
Block a user