Skip to content

那位大佬能搞一个腾讯云开发 CloudBase 一键部署的脚本 #577

Answered by baiheinet
baiheinet asked this question in Q&A
Discussion options

You must be logged in to vote

试验了一个简单的Dockerfile,云托管能用,记录一下

# https://hub.docker.com/_/node
FROM node:16-stretch-slim

# Create and change to the app directory.
WORKDIR /usr/src/app

# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
COPY package*.json ./

# Install production dependencies.
RUN yarn install --production

# Copy local code to the container image.
COPY . ./
# Run the web service on container startup.
RUN yarn node -r dotenv/config packages/app/server/lib/index.js -- start

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by baiheinet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request good first issue Good for newcomers
1 participant