Convert landing-page and database services to custom Dockerfile builds to avoid host volume mounting errors
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
FROM mysql:8.0
|
||||
|
||||
# Copy the initialization SQL script into the container
|
||||
COPY ./init-db.sql /docker-entrypoint-initdb.d/init-db.sql
|
||||
+6
-6
@@ -1,10 +1,9 @@
|
||||
services:
|
||||
# 1. Reverse Proxy & Landing Page
|
||||
landing-page:
|
||||
image: nginx:alpine
|
||||
volumes:
|
||||
- ./landing-page:/usr/share/nginx/html:ro
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
build:
|
||||
context: .
|
||||
dockerfile: landing-page.Dockerfile
|
||||
depends_on:
|
||||
- poverty-mapping
|
||||
- tugas-spbu
|
||||
@@ -57,7 +56,9 @@ services:
|
||||
|
||||
# 4. Database MySQL
|
||||
db:
|
||||
image: mysql:8.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: db.Dockerfile
|
||||
command: --default-authentication-plugin=mysql_native_password
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-root_password}
|
||||
@@ -66,7 +67,6 @@ services:
|
||||
- MYSQL_PASSWORD=${DB_PASSWORD:-webgis_password}
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql
|
||||
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copy landing page static files
|
||||
COPY ./landing-page /usr/share/nginx/html
|
||||
|
||||
# Copy custom nginx configuration
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
Reference in New Issue
Block a user