小编Ces*_*iva的帖子

无法 Dockerize Vite React-Typescript 项目

我正在尝试对 Vite React-Typescript 样板设置进行 dockerize,但无法连接到容器。

安装了 vite-react-typescript 样板:

npm init vite@latest vite-docker-demo -- --template react-ts

Dockerfile

# Declare the base image
FROM node:lts-alpine3.14
# Build step
# 1. copy package.json and package-lock.json to /app dir
RUN mkdir /app
COPY package*.json /app
# 2. Change working directory to newly created app dir
WORKDIR /app
# 3 . Install dependencies
RUN npm ci
# 4. Copy the source code to /app dir
COPY . .
# 5. Expose port 3000 on the …
Run Code Online (Sandbox Code Playgroud)

node.js typescript docker reactjs vite

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

docker ×1

node.js ×1

reactjs ×1

typescript ×1

vite ×1