chore: add Docker deployment setup
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: webgis_miskin_app
|
||||
working_dir: /var/www/html
|
||||
ports:
|
||||
- "${APP_PORT:-8000}:8000"
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
- webgis_vendor:/var/www/html/vendor
|
||||
environment:
|
||||
APP_ENV: ${APP_ENV:-production}
|
||||
APP_DEBUG: ${APP_DEBUG:-false}
|
||||
APP_URL: ${APP_URL:-http://localhost:8000}
|
||||
DB_CONNECTION: ${DB_CONNECTION:-mysql}
|
||||
DB_HOST: ${DB_HOST:-mysql}
|
||||
DB_PORT: ${DB_PORT:-3306}
|
||||
DB_DATABASE: ${DB_DATABASE:-webgis_miskin}
|
||||
DB_USERNAME: ${DB_USERNAME:-webgis}
|
||||
DB_PASSWORD: ${DB_PASSWORD:-secret}
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
|
||||
vite:
|
||||
image: node:22-alpine
|
||||
container_name: webgis_miskin_vite
|
||||
working_dir: /var/www/html
|
||||
entrypoint: ["sh", "/var/www/html/docker/node/entrypoint.sh"]
|
||||
command: ["npm", "run", "dev", "--", "--host=0.0.0.0", "--port=5173"]
|
||||
ports:
|
||||
- "5173:5173"
|
||||
volumes:
|
||||
- ./:/var/www/html
|
||||
- webgis_node_modules:/var/www/html/node_modules
|
||||
environment:
|
||||
CHOKIDAR_USEPOLLING: "true"
|
||||
VITE_DEV_SERVER_URL: http://localhost:5173
|
||||
profiles:
|
||||
- dev
|
||||
|
||||
mysql:
|
||||
image: mysql:8.4
|
||||
container_name: webgis_miskin_mysql
|
||||
ports:
|
||||
- "${MYSQL_HOST_PORT:-3307}:3306"
|
||||
environment:
|
||||
MYSQL_DATABASE: ${DB_DATABASE:-webgis_miskin}
|
||||
MYSQL_USER: ${DB_USERNAME:-webgis}
|
||||
MYSQL_PASSWORD: ${DB_PASSWORD:-secret}
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
|
||||
volumes:
|
||||
- webgis_mysql_data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -u$${MYSQL_USER} -p$${MYSQL_PASSWORD} --silent"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
|
||||
volumes:
|
||||
webgis_vendor:
|
||||
webgis_node_modules:
|
||||
webgis_mysql_data:
|
||||
Reference in New Issue
Block a user