]> PHS Git Server - phs-stack.git/commitdiff
Initial commit.
authorcharleswrayjr <charleswrayjr@gmail.com>
Thu, 4 Sep 2025 02:10:36 +0000 (21:10 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Thu, 4 Sep 2025 02:10:36 +0000 (21:10 -0500)
.gitignore [new file with mode: 0644]
.idea/.gitignore [new file with mode: 0644]
.idea/material_theme_project_new.xml [new file with mode: 0644]
.idea/modules.xml [new file with mode: 0644]
.idea/phs-stack.iml [new file with mode: 0644]
.idea/vcs.xml [new file with mode: 0644]
docker-compose.yml [new file with mode: 0644]
images/db/Dockerfile [new file with mode: 0644]
images/phs-api/Dockerfile [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..765f033
--- /dev/null
@@ -0,0 +1,2 @@
+.DS_Store
+volumes/
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644 (file)
index 0000000..13566b8
--- /dev/null
@@ -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 (file)
index 0000000..af802c9
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="MaterialThemeProjectNewConfig">
+    <option name="metadata">
+      <MTProjectMetadataState>
+        <option name="migrated" value="true" />
+        <option name="pristineConfig" value="false" />
+        <option name="userId" value="351393cd:182cd05972c:-8000" />
+        <option name="version" value="8.13.2" />
+      </MTProjectMetadataState>
+    </option>
+    <option name="titleBarState">
+      <MTProjectTitleBarConfigState>
+        <option name="overrideColor" value="false" />
+      </MTProjectTitleBarConfigState>
+    </option>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644 (file)
index 0000000..569a851
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/phs-stack.iml" filepath="$PROJECT_DIR$/.idea/phs-stack.iml" />
+    </modules>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/phs-stack.iml b/.idea/phs-stack.iml
new file mode 100644 (file)
index 0000000..657e3c5
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/.tmp" />
+      <excludeFolder url="file://$MODULE_DIR$/temp" />
+      <excludeFolder url="file://$MODULE_DIR$/tmp" />
+      <excludeFolder url="file://$MODULE_DIR$/volumes" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644 (file)
index 0000000..94a25f7
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644 (file)
index 0000000..aa1e3b0
--- /dev/null
@@ -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 (file)
index 0000000..5061e56
--- /dev/null
@@ -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 (file)
index 0000000..7857d7b
--- /dev/null
@@ -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