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:
|
services:
|
||||||
# 1. Reverse Proxy & Landing Page
|
# 1. Reverse Proxy & Landing Page
|
||||||
landing-page:
|
landing-page:
|
||||||
image: nginx:alpine
|
build:
|
||||||
volumes:
|
context: .
|
||||||
- ./landing-page:/usr/share/nginx/html:ro
|
dockerfile: landing-page.Dockerfile
|
||||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- poverty-mapping
|
- poverty-mapping
|
||||||
- tugas-spbu
|
- tugas-spbu
|
||||||
@@ -57,7 +56,9 @@ services:
|
|||||||
|
|
||||||
# 4. Database MySQL
|
# 4. Database MySQL
|
||||||
db:
|
db:
|
||||||
image: mysql:8.0
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: db.Dockerfile
|
||||||
command: --default-authentication-plugin=mysql_native_password
|
command: --default-authentication-plugin=mysql_native_password
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-root_password}
|
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-root_password}
|
||||||
@@ -66,7 +67,6 @@ services:
|
|||||||
- MYSQL_PASSWORD=${DB_PASSWORD:-webgis_password}
|
- MYSQL_PASSWORD=${DB_PASSWORD:-webgis_password}
|
||||||
volumes:
|
volumes:
|
||||||
- mysql_data:/var/lib/mysql
|
- mysql_data:/var/lib/mysql
|
||||||
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
|
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
volumes:
|
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