nodejs DE by docker-compose.yml
docker-compose.yml:
version: '3'
services:
cli:
image: nestjs/cli
volumes:
- ./:/workspace
tty: true
nest:
image: node:${NODE_VERSION}
working_dir: /home/node/app
command: npm config set registry https://registry.npm.taobao.org
command: npm run start:dev
volumes:
- ./app:/home/node/app
ports:
- ${APP_PORT}:3000
mysql:
image: mysql:${MYSQL_VERSION}
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
ports:
- ${MYSQL_PORT}:3306
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
.env:
NODE_VERSION=11.13
APP_PORT=3000
MYSQL_VERSION=5.7
MYSQL_PORT=3306
MYSQL_DATABASE=nest
MYSQL_USER=nest
MYSQL_ROOT_PASSWORD=root
MYSQL_PASSWORD=password
run and log
start
start -d
log
浙公网安备 33010602011771号