Build app image with bundled source

This commit is contained in:
luthfihadinugroho79
2026-06-11 15:21:52 +07:00
parent f8f211a500
commit 59c768d666
2 changed files with 30 additions and 12 deletions
+4
View File
@@ -0,0 +1,4 @@
.git
**/.git
**/node_modules
**/.TugasSIG01-SPBU-point/.TugasSIG01-SPBU-point/node_modules
+26 -12
View File
@@ -1,6 +1,31 @@
services:
app:
image: php:8.2-apache
build:
context: .
dockerfile_inline: |
FROM php:8.2-apache
RUN docker-php-ext-install mysqli pdo pdo_mysql \
&& a2enmod rewrite \
&& printf '%s\n' \
'<Directory /var/www/html>' \
' Options FollowSymLinks' \
' AllowOverride All' \
' Require all granted' \
'</Directory>' \
'DirectoryIndex index.php index.html' \
> /etc/apache2/conf-available/webgis.conf \
&& a2enconf webgis
COPY . /var/www/html/
RUN mkdir -p /var/www/html/02/uploads \
/var/www/html/05/assets/uploads \
/var/www/html/05/uploads/bukti \
&& chmod -R a+rX /var/www/html \
&& chown -R www-data:www-data /var/www/html/02/uploads \
/var/www/html/05/assets/uploads \
/var/www/html/05/uploads
expose:
- "80"
environment:
@@ -8,17 +33,6 @@ services:
DB_USER: webgis
DB_PASSWORD: webgis_password
DB_NAME: webgis_project
volumes:
- ./:/var/www/html
command: >
bash -lc "docker-php-ext-install mysqli pdo pdo_mysql
&& a2enmod rewrite
&& printf '%s\\n' '<Directory /var/www/html>' ' Options Indexes FollowSymLinks' ' AllowOverride All' ' Require all granted' '</Directory>' 'DirectoryIndex index.php index.html' > /etc/apache2/conf-available/webgis.conf
&& a2enconf webgis
&& mkdir -p /var/www/html/02/uploads /var/www/html/05/assets/uploads /var/www/html/05/uploads/bukti
&& chmod -R a+rX /var/www/html
&& chown -R www-data:www-data /var/www/html/02/uploads /var/www/html/05/assets/uploads /var/www/html/05/uploads
&& apache2-foreground"
depends_on:
db:
condition: service_healthy