Doc update and SQL init
This commit is contained in:
@@ -1,26 +1,19 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# MySQL Database
|
||||
db:
|
||||
image: mysql:8.0
|
||||
build: ./db-init
|
||||
container_name: ppr_nextgen_db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: rootpassword123
|
||||
MYSQL_DATABASE: ppr_nextgen
|
||||
MYSQL_USER: ppr_user
|
||||
MYSQL_PASSWORD: ppr_password123
|
||||
ports:
|
||||
- "3307:3306" # Use different port to avoid conflicts
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||
MYSQL_DATABASE: ${DB_NAME}
|
||||
MYSQL_USER: ${DB_USER}
|
||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
- ./init_db.sql:/docker-entrypoint-initdb.d/01-schema.sql
|
||||
- ./02-import-data.sql:/docker-entrypoint-initdb.d/02-import-data.sql
|
||||
- ./airports_data_clean.csv:/var/lib/mysql-files/airports_data.csv
|
||||
- ./aircraft_data.csv:/var/lib/mysql-files/aircraft_data.csv
|
||||
networks:
|
||||
- ppr_network
|
||||
- private_network
|
||||
|
||||
# FastAPI Backend
|
||||
api:
|
||||
@@ -28,23 +21,24 @@ services:
|
||||
container_name: ppr_nextgen_api
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
DB_HOST: db
|
||||
DB_USER: ppr_user
|
||||
DB_PASSWORD: ppr_password123
|
||||
DB_NAME: ppr_nextgen
|
||||
DB_PORT: 3306
|
||||
SECRET_KEY: super-secret-key-for-nextgen-ppr-system-change-in-production
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES: 30
|
||||
API_V1_STR: /api/v1
|
||||
PROJECT_NAME: "Airfield PPR API NextGen"
|
||||
DB_HOST: ${DB_HOST}
|
||||
DB_USER: ${DB_USER}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
DB_NAME: ${DB_NAME}
|
||||
DB_PORT: ${DB_PORT}
|
||||
SECRET_KEY: ${SECRET_KEY}
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES}
|
||||
API_V1_STR: ${API_V1_STR}
|
||||
PROJECT_NAME: ${PROJECT_NAME}
|
||||
ports:
|
||||
- "8001:8000" # Use different port to avoid conflicts with existing system
|
||||
- "${API_PORT_EXTERNAL}:8000" # Use different port to avoid conflicts with existing system
|
||||
depends_on:
|
||||
- db
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
networks:
|
||||
- ppr_network
|
||||
- private_network
|
||||
- public_network
|
||||
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
||||
|
||||
# Redis for caching (optional for now)
|
||||
@@ -52,10 +46,8 @@ services:
|
||||
image: redis:7-alpine
|
||||
container_name: ppr_nextgen_redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6380:6379" # Use different port
|
||||
networks:
|
||||
- ppr_network
|
||||
- private_network
|
||||
|
||||
# Nginx web server for public frontend
|
||||
web:
|
||||
@@ -63,14 +55,14 @@ services:
|
||||
container_name: ppr_nextgen_web
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8082:80" # Public web interface
|
||||
- "${WEB_PORT_EXTERNAL}:80" # Public web interface
|
||||
volumes:
|
||||
- ./web:/usr/share/nginx/html
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||
depends_on:
|
||||
- api
|
||||
networks:
|
||||
- ppr_network
|
||||
- public_network
|
||||
|
||||
# phpMyAdmin for database management
|
||||
phpmyadmin:
|
||||
@@ -78,21 +70,24 @@ services:
|
||||
container_name: ppr_nextgen_phpmyadmin
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
PMA_HOST: db
|
||||
PMA_PORT: 3306
|
||||
PMA_USER: ppr_user
|
||||
PMA_PASSWORD: ppr_password123
|
||||
UPLOAD_LIMIT: 50M
|
||||
PMA_HOST: ${PMA_HOST}
|
||||
PMA_PORT: ${DB_PORT}
|
||||
PMA_USER: ${DB_USER}
|
||||
PMA_PASSWORD: ${DB_PASSWORD}
|
||||
UPLOAD_LIMIT: ${UPLOAD_LIMIT}
|
||||
ports:
|
||||
- "8083:80" # phpMyAdmin web interface
|
||||
- "${PMA_PORT_EXTERNAL}:80" # phpMyAdmin web interface
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
- ppr_network
|
||||
- private_network
|
||||
- public_network
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
||||
|
||||
networks:
|
||||
ppr_network:
|
||||
private_network:
|
||||
driver: bridge
|
||||
public_network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user