mirror of https://github.com/certd/certd
chore: 重构image build
parent
0ef7b036dd
commit
4afbf20c1a
|
@ -0,0 +1,23 @@
|
|||
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:18-alpine as builder
|
||||
EXPOSE 7001
|
||||
WORKDIR /workspace/
|
||||
RUN npm install -g pnpm@8.15.7 --registry=https://registry.npmmirror.com
|
||||
RUN pnpm config set registry https://registry.npmmirror.com/
|
||||
|
||||
RUN cd /workspace/certd-client && pnpm install && npm run build
|
||||
RUN cd /workspace/certd-server && pnpm install && npm run build
|
||||
|
||||
RUN cp /workspace/certd-client/dist/* /workspace/certd-server/public/ -rf
|
||||
|
||||
|
||||
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:18-alpine
|
||||
WORKDIR /app/
|
||||
COPY --from=builder /workspace/certd-server/ /app/
|
||||
ENV TZ Asia/Shanghai
|
||||
ENV NODE_ENV production
|
||||
ENV MIDWAY_SERVER_ENV production
|
||||
CMD ["npm", "run","start"]
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
version: '3.3' # 指定docker-compose 版本
|
||||
services: # 要拉起的服务们
|
||||
certd:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile
|
||||
image: registry.cn-shenzhen.aliyuncs.com/handsfree/certd:${TAG}
|
||||
container_name: certd # 容器名
|
||||
restart: unless-stopped # 重启
|
||||
ports: # 端口映射
|
||||
- "7001:7001"
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
|
Loading…
Reference in New Issue