mirror of
https://gh-proxy.org/https://github.com/klinsmaya/gateway.git
synced 2026-11-10 10:07:26 +08:00
28 lines
512 B
Docker
28 lines
512 B
Docker
# Use an official Node.js runtime as a parent image
|
|
FROM node:20-alpine
|
|
|
|
# Set the working directory in the container
|
|
WORKDIR /app
|
|
|
|
# Copy package.json and package-lock.json to the working directory
|
|
COPY package*.json ./
|
|
|
|
# Install app dependencies
|
|
RUN npm install
|
|
|
|
COPY ./ ./
|
|
|
|
RUN npm run build \
|
|
&& rm -rf node_modules \
|
|
&& npm install --production
|
|
|
|
# Bundle app source
|
|
COPY . .
|
|
|
|
# Expose the port your app runs on
|
|
EXPOSE 8787
|
|
|
|
ENTRYPOINT ["npm"]
|
|
|
|
# Define the command to run your app
|
|
CMD ["run", "start:node"] |