Skip to content

Commit

Permalink
Dockerize
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbauer committed Oct 23, 2024
1 parent 9e6283c commit 822dfc9
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 17 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM webdevops/php-nginx:8.3

WORKDIR /var/www/html
ENV WEB_DOCUMENT_ROOT /var/www/html/src

RUN apt-get update \
&& apt-get install -y procps

EXPOSE 80

COPY ./ $WORKDIR
17 changes: 17 additions & 0 deletions Dockerfile-local
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM webdevops/php-nginx:8.3

ADD config/nginx/default.conf /etc/nginx/conf.d

WORKDIR /var/www/html
ENV SERVER_ENV local
ENV WEB_DOCUMENT_ROOT /var/www/html

RUN apt-get update \
&& apt-get install -y procps \
&& pecl install xdebug

EXPOSE 80

COPY ./ $WORKDIR

CMD ["/bin/sh", "-c", "scripts/app_init_local.sh && supervisord"]
20 changes: 20 additions & 0 deletions config/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server {
listen 80;
server_name checkinrequestservice.local;
root /var/www/html;

location / {
try_files $uri $uri /index.php?$args;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 300s;
include fastcgi_params;
}
}
17 changes: 0 additions & 17 deletions db/docker-compose-db.yml

This file was deleted.

27 changes: 27 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services:
checkin-request-service-web:
build:
context: .
dockerfile: Dockerfile-local
container_name: checkin-request-service-web
ports:
- "8888:80"
networks:
checkinservice:
volumes:
- ./:/var/www/html
checkin-request-service-db:
image: postgres:10.5-alpine
container_name: checkin-service-postgres-db
environment:
- POSTGRES_DB=checkin_requests
- POSTGRES_PASSWORD=localpasswordsimplepassword
ports:
- "25432:5432"
networks:
checkinservice:
volumes:
- ./db/init-test-db.sql:/docker-entrypoint-initdb.d/init.sql

networks:
checkinservice:
7 changes: 7 additions & 0 deletions scripts/app_init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

echo "[app_init.sh] Changing dir to $(dirname "$0")."
cd "$(dirname "$0")"

echo "[app_init.sh] Composer install."
composer install --no-interaction --ignore-platform-reqs --working-dir=.. --no-dev
7 changes: 7 additions & 0 deletions scripts/app_init_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

echo "[app_init_local.sh] Changing dir to $(dirname "$0")."
cd "$(dirname "$0")"

echo "[app_init_local.sh] Composer install."
composer install --no-interaction --ignore-platform-reqs --working-dir=..

0 comments on commit 822dfc9

Please sign in to comment.