Fix Docker Compose: add PYTHONPATH for Alembic, use port 8100, fix Vite proxy for container networking
This commit is contained in:
@@ -18,15 +18,17 @@ services:
|
||||
backend:
|
||||
build: ./backend
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "8100:8000"
|
||||
env_file: ./backend/.env
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
working_dir: /app
|
||||
environment:
|
||||
- PYTHONPATH=/app
|
||||
command: >
|
||||
sh -c "
|
||||
pip install alembic psycopg2-binary &&
|
||||
cd /app &&
|
||||
alembic upgrade head &&
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
||||
"
|
||||
|
||||
@@ -7,7 +7,7 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8000',
|
||||
target: 'http://backend:8000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user