小编Oğu*_*naz的帖子

Css 不适用于 Dockerized VueJs 项目

我创建了一个 VueJs 项目并将其部署到 AWS。我已经根据文档 (Real-World Example section)对项目进行了 dockerized 。我刚刚添加了一行来复制我的 nginx conf 文件,如下所示:

# build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

# production stage
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY confs/nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Run Code Online (Sandbox Code Playgroud)

然后我意识到当我检查页面 url 时我的 css 不起作用。我也有一个这样的conf文件:

events {
  worker_connections  4096;  ## Default: 1024
}

http {

  server {

    listen 80;

    location / {
      root …
Run Code Online (Sandbox Code Playgroud)

css nginx vue.js

5
推荐指数
1
解决办法
83
查看次数

标签 统计

css ×1

nginx ×1

vue.js ×1