finally fixed ...
This commit is contained in:
parent
8996a9a730
commit
552a153fdf
4 changed files with 45 additions and 4 deletions
40
dc_files/build_and_run.sh
Executable file
40
dc_files/build_and_run.sh
Executable file
|
@ -0,0 +1,40 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Build images
|
||||
docker build -t demo-frontend ../frontend
|
||||
docker build -t demo-backend ../backend
|
||||
|
||||
# Create network if it doesn't exist
|
||||
docker network create demo-network || true
|
||||
|
||||
# Start PostgreSQL
|
||||
docker run -d \
|
||||
--name demo-db \
|
||||
--network demo-network \
|
||||
-e POSTGRES_DB=todo_db \
|
||||
-e POSTGRES_USER=postgres \
|
||||
-e POSTGRES_PASSWORD=postgres \
|
||||
-p 5432:5432 \
|
||||
-v postgres_data:/var/lib/postgresql/data \
|
||||
postgres:13
|
||||
|
||||
# Start Backend
|
||||
docker run -d \
|
||||
--name demo-backend \
|
||||
--network demo-network \
|
||||
-e DB_NAME=todo_db \
|
||||
-e DB_USER=postgres \
|
||||
-e DB_PASSWORD=postgres \
|
||||
-e DB_HOST=demo-db \
|
||||
-e DB_PORT=5432 \
|
||||
-e DEBUG=1 \
|
||||
-p 8000:8000 \
|
||||
demo-backend
|
||||
|
||||
# Start Frontend
|
||||
docker run -d \
|
||||
--name demo-frontend \
|
||||
--network demo-network \
|
||||
-e VITE_API_URL=http://localhost:8000/api \
|
||||
-p 5173:5173 \
|
||||
demo-frontend
|
8
dc_files/docker-compose.override.yml
Normal file
8
dc_files/docker-compose.override.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
services:
|
||||
backend:
|
||||
volumes:
|
||||
- /path/to/local/backend:/app
|
||||
|
||||
frontend:
|
||||
volumes:
|
||||
- /path/to/local/frontend:/app
|
41
dc_files/docker-compose_ssh_git.yml
Normal file
41
dc_files/docker-compose_ssh_git.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
services:
|
||||
db:
|
||||
image: postgres:13
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_DB=todo_db
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ssh://git@git.impstyle.com:222/test/demo-backend.git#main # Replace with your backend repo URL
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- DB_NAME=todo_db
|
||||
- DB_USER=postgres
|
||||
- DB_PASSWORD=postgres
|
||||
- DB_HOST=db
|
||||
- DB_PORT=5432
|
||||
- DEBUG=1
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
frontend:
|
||||
build:
|
||||
context: ssh://git@git.impstyle.com:222/test/demo-frontend.git#main # Replace with your frontend repo URL
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "5173:5173"
|
||||
environment:
|
||||
- VITE_API_URL=http://localhost:8000/api
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
Loading…
Add table
Add a link
Reference in a new issue