From 21ce1e3638ce2d9dd99de4ac8291fa7a81f09570 Mon Sep 17 00:00:00 2001 From: sagautam5 Date: Sun, 21 Apr 2024 14:09:54 +0545 Subject: [PATCH 1/3] dockerize local states nepal --- Dockerfile | 9 +++++++++ docker-compose.yml | 35 +++++++++++++++++++++++++++++++++++ localstates.conf | 18 ++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100755 Dockerfile create mode 100755 docker-compose.yml create mode 100755 localstates.conf diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 0000000..a888764 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM php:7.1-fpm + +RUN apt-get update && apt-get upgrade -y &&\ + apt-get install -y git && \ + apt-get install -y unzip && \ + apt-get install -y vim + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +ENV PATH="${PATH}:/root/.composer/vendor/bin" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..2894ddc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,35 @@ +version: '1.0' +services: + localstates: + build: + context: ./ + dockerfile: Dockerfile + image: localstates + working_dir: /var/www/html/ + volumes: + - ./:/var/www/html + expose: + - 9000 + tty: true + restart: unless-stopped + container_name: localstates + networks: + - lsn + + nginx: + image: nginx:alpine-slim + volumes: + - ./:/var/www/html + - ./localstates.conf:/etc/nginx/conf.d/localstates.conf + ports: + - 80:80 + depends_on: + - localstates + container_name: lsn_nginx + restart: unless-stopped + tty: true + networks: + - lsn +networks: + lsn: + driver: bridge diff --git a/localstates.conf b/localstates.conf new file mode 100755 index 0000000..98bdaee --- /dev/null +++ b/localstates.conf @@ -0,0 +1,18 @@ +server { + listen 80; + server_name localstates.test www.localstates.test; + + root /var/www/html/demo; + + location / { + index index.php index.html; + } + + location ~* \.php$ { + fastcgi_pass localstates:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } +} \ No newline at end of file From 9d9f067d20dbdab35fe7421c21abf36cb372b348 Mon Sep 17 00:00:00 2001 From: sagautam5 Date: Sun, 21 Apr 2024 14:16:06 +0545 Subject: [PATCH 2/3] update demo api url --- demo/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/index.php b/demo/index.php index 789fd2c..09cbeda 100644 --- a/demo/index.php +++ b/demo/index.php @@ -80,7 +80,7 @@ function reloadProvinces(lang) $('.ward').find("option:gt(0)").remove(); $.ajax({ - url: '/local-states-nepal/demo/api/provinces.php?lang='+lang, + url: 'api/provinces.php?lang='+lang, type: 'GET', dataType: 'json', }).done(function (data) { @@ -104,7 +104,7 @@ function reloadProvinces(lang) $('.ward').find("option:gt(0)").remove(); var selected = $(this).find(":selected").attr('value'); $.ajax({ - url: '/local-states-nepal/demo/api/districts.php?lang='+lang+'&&province_id=' + selected, + url: 'api/districts.php?lang='+lang+'&&province_id=' + selected, type: 'GET', dataType: 'json', }).done(function (data) { @@ -120,7 +120,7 @@ function reloadProvinces(lang) $('.ward').find("option:gt(0)").remove(); var selected = $(this).find(":selected").attr('value'); $.ajax({ - url: '/local-states-nepal/demo/api/municipalities.php?lang='+lang+'&&district_id=' + selected, + url: 'api/municipalities.php?lang='+lang+'&&district_id=' + selected, type: 'GET', dataType: 'json', }).done(function (data) { @@ -135,7 +135,7 @@ function reloadProvinces(lang) var selected = $(this).find(":selected").attr('value'); $('.ward').find("option:gt(0)").remove(); $.ajax({ - url: '/local-states-nepal/demo/api/wards.php?lang='+lang+'&&municipality_id=' + selected, + url: 'api/wards.php?lang='+lang+'&&municipality_id=' + selected, type: 'GET', dataType: 'json', }).done(function (data) { From 9b2f30678555836228ccb9a8749ecb0ff8998bad Mon Sep 17 00:00:00 2001 From: sagautam5 Date: Sun, 21 Apr 2024 15:08:45 +0545 Subject: [PATCH 3/3] set default php version 7.4 for now --- Dockerfile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index a888764..23e6a38 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1 @@ -FROM php:7.1-fpm - -RUN apt-get update && apt-get upgrade -y &&\ - apt-get install -y git && \ - apt-get install -y unzip && \ - apt-get install -y vim - -RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer -ENV PATH="${PATH}:/root/.composer/vendor/bin" \ No newline at end of file +FROM sagautam5/localstates_7.4:v1.0 \ No newline at end of file