blog icon indicating copy to clipboard operation
blog copied to clipboard

常用的Docker配置及使用

Open axetroy opened this issue 7 years ago • 2 comments

使用docker-compose组件镜像容器

docker-compose up
docker-compose down

nginx

托管静态目录

version: '3'
services:
  i18n_nginx_static:
    image: nginx:1.13.8-alpine
    restart: always
    working_dir: /home/static
    volumes:
       - ./dist:/usr/share/nginx/html
    ports:
      - 6098:80

NodeJS

启动NodeJS App

version: '3'
services:
  pg:
    image: postgres:9.6.6-alpine
    restart: always
    volumes:
      - "./docker/volumes/pg:/var/lib/postgresql/data"
    ports:
      - 6432:5432
  node:
    image: keymetrics/pm2:8-alpine
    user: "node"
    working_dir: /home/node/app
    environment:
      - NODE_ENV=production
    volumes:
      - ./:/home/node/app
    ports:
      - 6099:6099
    links:
      - pg

最后

记录下我写的 Docker compose 配置集合,集合了一些常用的配置

https://github.com/axetroy/docker-configuration

axetroy avatar Dec 29 '17 09:12 axetroy

The maintainers of this repository would appreciate it if you could provide more information.

request-info[bot] avatar Dec 29 '17 09:12 request-info[bot]

借楼说话,老哥你这个拉取github数据再渲染的项目真的神奇,一万个赞

xb21 avatar Jan 05 '18 01:01 xb21