From: charleswrayjr Date: Thu, 4 Sep 2025 02:10:36 +0000 (-0500) Subject: Initial commit. X-Git-Url: https://git.phasecustomsoft.com/static/git-favicon.png?a=commitdiff_plain;h=b210963a1e1f980995c89c4852f6a957d94c2853;p=phs-stack.git Initial commit. --- b210963a1e1f980995c89c4852f6a957d94c2853 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..765f033 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +volumes/ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..af802c9 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..569a851 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/phs-stack.iml b/.idea/phs-stack.iml new file mode 100644 index 0000000..657e3c5 --- /dev/null +++ b/.idea/phs-stack.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..aa1e3b0 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,83 @@ +services: + db: + build: + dockerfile: Dockerfile + context: ./images/db + hostname: phs-db + container_name: phs-db + environment: + CLR_ENV: ${CLR_ENV} + TZ: America/Chicago + POSTGRES_USER: postgres + POSTGRES_PASSWORD: ab9cfz12 + POSTGRES_DB: postgres + PORT: 5432 + ports: + - "54327:5432" + volumes: + - ./volumes/data:/var/lib/postgresql/data + command: postgres -c 'max_connections=500' + networks: + - phs-net + restart: unless-stopped + api: + build: + dockerfile: Dockerfile + context: ./images/phs-api + hostname: phs-api + container_name: phs-api + security_opt: + - apparmor:unconfined + user: node + working_dir: "/usr/src/app" + environment: + CLR_ENV: ${CLR_ENV} + TZ: America/Chicago + volumes: + - ./volumes/phs-api:/usr/src/app + - ./volumes/phs-api/pm2logs:/home/node/.pm2/logs + ports: + - 23602:3601 + entrypoint: sh -c "/usr/src/app/run-api.sh" + networks: + - phs-net + employee: + build: + dockerfile: Dockerfile + context: ./volumes/phs-employee/ + hostname: phs-employee + container_name: phs-employee + user: node + working_dir: "/usr/src/app" + environment: + - CLR_ENV=${CLR_ENV} + - TZ=America/Chicago + volumes: + - ./volumes/phs-employee:/usr/src/app + ports: + - 30007:3000 + networks: + - phs-net + restart: unless-stopped + entrypoint: sh -c "/usr/src/app/run-employee.sh" + admin: + build: + dockerfile: Dockerfile + context: ./volumes/phs-admin/ + hostname: phs-admin + container_name: phs-admin + user: node + working_dir: "/usr/src/app" + environment: + - CLR_ENV=${CLR_ENV} + - TZ=America/Chicago + volumes: + - ./volumes/phs-admin:/usr/src/app + ports: + - 30008:3000 + networks: + - phs-net + restart: unless-stopped + entrypoint: sh -c "/usr/src/app/run-admin.sh" +networks: + phs-net: diff --git a/images/db/Dockerfile b/images/db/Dockerfile new file mode 100644 index 0000000..5061e56 --- /dev/null +++ b/images/db/Dockerfile @@ -0,0 +1 @@ +FROM postgres:12 \ No newline at end of file diff --git a/images/phs-api/Dockerfile b/images/phs-api/Dockerfile new file mode 100644 index 0000000..7857d7b --- /dev/null +++ b/images/phs-api/Dockerfile @@ -0,0 +1,12 @@ +FROM node:20.12.1 +WORKDIR /usr/src/app +RUN groupmod -g 1001 node && usermod -u 1001 -g 1001 node +RUN npm install nodemon -g +RUN npm install -g ts-node +RUN apt update && apt install -y vim mlocate && rm -r /var/lib/apt/lists/* + +USER node +RUN mkdir /home/node/.pm2 + +RUN npx pm2 install pm2-logrotate +RUN npx pm2 set pm2-logrotate:max_size 500M \ No newline at end of file