mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-03 02:52:08 +08:00
Support docker source code construction
This commit is contained in:
20
kafka-manager-console/Dockerfile
Normal file
20
kafka-manager-console/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
ARG NODE_VERSION=12.20.0
|
||||
ARG NGINX_VERSION=1.21.5-alpine
|
||||
FROM node:${NODE_VERSION} AS builder
|
||||
ARG OUTPUT_PATH=dist
|
||||
|
||||
ENV TZ Asia/Shanghai
|
||||
WORKDIR /opt
|
||||
COPY . .
|
||||
RUN npm config set registry https://registry.npm.taobao.org \
|
||||
&& npm install \
|
||||
# Change the output directory to dist
|
||||
&& sed -i "s#../kafka-manager-web/src/main/resources/templates#$OUTPUT_PATH#g" webpack.config.js \
|
||||
&& npm run prod-build
|
||||
|
||||
FROM nginx:${NGINX_VERSION}
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
COPY --from=builder /opt/dist /opt/dist
|
||||
COPY --from=builder /opt/web.conf /etc/nginx/conf.d/default.conf
|
||||
13
kafka-manager-console/web.conf
Normal file
13
kafka-manager-console/web.conf
Normal file
@@ -0,0 +1,13 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
root /opt/dist;
|
||||
try_files $uri $uri/ /index.html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://logikm-backend:8080;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user