我已经.env在 docker ignore 中添加了,并且在构建图像后环境变量未定义,那么如何在docker-compose.yml文件中配置这些环境变量
我们是否也应该docker-compose.yml忽略?
码头工人-compose.yml
version: '3'
services:
client:
build:
context: .
dockerfile: Dockerfile.dev
command: npm start
container_name: testReact
ports:
- "3000:3000"
volumes:
- ./:/app
- /app/node_modules
.env
REACT_APP_CONSTANT = 'MY REACT APP'
.dockerignore
/node_modules
/build
.git
*.md
.gitignore
.env