【发布时间】:2019-02-21 21:11:37
【问题描述】:
我有一个用 vuejs 编写的单页应用程序 我想使用 digitalocean、nginx 和 docker 部署应用程序
我的问题是, 我需要在配置文件/docker 文件中添加什么 使应用程序将使用 https 而不是 http? (我将使用自签名证书)
是的,我已经搜索过这个问题,但似乎没有任何效果 使用那个模板。
另外,这个应用程序的后端是带有 express 的 nodejs 这将在同一个数字海洋服务器上的不同容器上
我正在使用来自 vue docs 的 docker 文件模板:
码头文件:
# build stage
FROM node:9.11.1-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# production stage
FROM nginx:1.13.12-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
nginx.conf:
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
谢谢。
【问题讨论】:
标签: docker nginx vue.js single-page-application digital-ocean