其他分享
首页 > 其他分享> > docker-compose 部署eggjs

docker-compose 部署eggjs

作者:互联网

1.目录结构

docker-compose.yaml  Dockerfile  egg

2.docker-compose.yaml

version: '2'
services:
  egg_test:
    build: .
    ports:
      - "3002:7001"

3.Dockerfile

FROM node:16.3.0
RUN mkdir -p /home/dockerfile/egg-example
WORKDIR /home/dockerfile/egg-example
RUN npm -g install npm:latest
COPY egg/ /home/dockerfile/egg-example
RUN npm i
EXPOSE 7001
CMD npm run dev

4.egg

egg项目

5.构建

docker-compose -f docker-compose.yaml up --build

6.运行效果

http://127.0.0.1:3002/

标签:npm,compose,yaml,eggjs,home,docker,egg
来源: https://blog.csdn.net/bbsyi/article/details/121651441