Refactor docker-compose to include API key in environment variables for server and client
This commit is contained in:
@@ -5,6 +5,8 @@ services:
|
|||||||
- inventory-network
|
- inventory-network
|
||||||
volumes:
|
volumes:
|
||||||
- server-data:/data
|
- server-data:/data
|
||||||
|
environment:
|
||||||
|
- API_KEY=${API_KEY:-}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/api/health',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))"]
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/api/health',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))"]
|
||||||
@@ -14,7 +16,10 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
|
|
||||||
client:
|
client:
|
||||||
build: ./client
|
build:
|
||||||
|
context: ./client
|
||||||
|
args:
|
||||||
|
VITE_API_KEY: ${API_KEY:-}
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Reference in New Issue
Block a user