docker config
This commit is contained in:
6
.env
6
.env
@@ -1,9 +1,9 @@
|
|||||||
# Frontend
|
# Frontend
|
||||||
FRONTEND_PORT=3000
|
DIALECTIC_FRONTEND_PORT=3000
|
||||||
|
|
||||||
# Backend
|
# Backend
|
||||||
BACKEND_PORT=8090
|
DIALECTIC_BACKEND_PORT=8090
|
||||||
BACKEND_URL=http://localhost:8090
|
DIALECTIC_BACKEND_URL=http://localhost:8090
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
|
|||||||
Submodule Dialectic.Backend updated: 5972267d18...e049b1c4bd
Submodule Dialectic.Frontend updated: bd03492ef4...f9665c92ce
@@ -4,19 +4,18 @@ services:
|
|||||||
context: ./Dialectic.Frontend
|
context: ./Dialectic.Frontend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "${FRONTEND_PORT:-3000}:3000"
|
- "${DIALECTIC_FRONTEND_PORT:-3000}:3000"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- DIALECTIC_REACT_APP_BACKEND_HOST=${DIALECTIC_BACKEND_URL:-http://localhost:8000}
|
||||||
- REACT_APP_BACKEND_HOST=${BACKEND_URL:-http://localhost:8000}
|
networks:
|
||||||
stdin_open: true
|
- app-network
|
||||||
tty: true
|
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./Dialectic.Backend
|
context: ./Dialectic.Backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "${BACKEND_PORT:-8000}:8000"
|
- "${DIALECTIC_BACKEND_PORT:-8000}:8000"
|
||||||
volumes:
|
volumes:
|
||||||
- dialectic_config:/app/config
|
- dialectic_config:/app/config
|
||||||
environment:
|
environment:
|
||||||
@@ -26,7 +25,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
networks:
|
||||||
|
- app-network
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: mysql:8.0
|
image: mysql:8.0
|
||||||
@@ -45,7 +45,12 @@ services:
|
|||||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
||||||
timeout: 20s
|
timeout: 20s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
volumes:
|
volumes:
|
||||||
mysql_data:
|
mysql_data:
|
||||||
dialectic_config:
|
dialectic_config:
|
||||||
|
|
||||||
|
networks:
|
||||||
|
app-network:
|
||||||
|
driver: bridge
|
||||||
40
docker-publish
Normal file
40
docker-publish
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
BUILD_BACKEND=false
|
||||||
|
BUILD_FRONTEND=false
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
BUILD_BACKEND=true
|
||||||
|
BUILD_FRONTEND=true
|
||||||
|
else
|
||||||
|
for arg in "$@"; do
|
||||||
|
case $arg in
|
||||||
|
--backend)
|
||||||
|
BUILD_BACKEND=true
|
||||||
|
;;
|
||||||
|
--frontend)
|
||||||
|
BUILD_FRONTEND=true
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "unknown:$arg"
|
||||||
|
echo "usage: $0 [ --backend | --frontend ]"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$BUILD_BACKEND" = true ]; then
|
||||||
|
cd Dialectic.Backend
|
||||||
|
docker build -t git.hangman-lab.top/hzhang/dialectic-backend:latest .
|
||||||
|
docker push git.hangman-lab.top/hzhang/dialectic-backend:latest
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$BUILD_FRONTEND" = true ]; then
|
||||||
|
cd Dialectic.Frontend
|
||||||
|
docker build -t git.hangman-lab.top/hzhang/dialectic-frontend:latest .
|
||||||
|
docker push git.hangman-lab.top/hzhang/dialectic-frontend:latest
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user