-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/japa-tests' into fix/deps
- Loading branch information
Showing
24 changed files
with
26,147 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
npm-debug.log | ||
Dockerfile | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Node.js CI | ||
on: [push] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
- run: npm ci | ||
- run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"discord.enabled": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM node:latest | ||
# Set the working directory | ||
RUN apt-get update && apt-get install -y --no-install-recommends dumb-init | ||
WORKDIR /home/node/app | ||
# Before switching to user 'node', ensure the directory exists and has the correct permissions | ||
RUN mkdir -p /home/node/app/node_modules && mkdir /home/node/app/tapstore && chown -R node:node /home/node/app | ||
# Copying with chown in a single line before npm install to avoid permission issues. | ||
COPY --chown=node:node . . | ||
# Install dependencies | ||
RUN npm install | ||
# Expose ports | ||
EXPOSE 5099 | ||
EXPOSE 13337 | ||
# RUN chmod -R 777 /home/node/ | ||
USER node | ||
ENV NODE_ENV production | ||
|
||
CMD [ "dumb-init", "npm", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { configure, processCLIArgs, run } from '@japa/runner' | ||
import { expect } from '@japa/expect' | ||
import { apiClient } from '@japa/api-client' | ||
|
||
processCLIArgs(process.argv.splice(2)) | ||
configure({ | ||
files: ['tests/**/*.spec.js'], | ||
plugins: [expect(), apiClient('http://localhost:5099')], | ||
}) | ||
|
||
run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
version: '3.8' | ||
networks: | ||
monitoring: | ||
driver: bridge | ||
|
||
volumes: | ||
prometheus_data: {} | ||
grafana_storage: {} | ||
tapstore: {} | ||
|
||
services: | ||
trac-core: | ||
# image: tap-reader | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
# expose: | ||
# - 13337 | ||
# - 5099 | ||
ports: | ||
- '13337:13337' | ||
- '5099:5099' | ||
networks: | ||
- monitoring | ||
# volumes: | ||
# - 'tapstore:/home/node/app/tapstore' | ||
|
||
grafana: | ||
build: | ||
context: ./grafana | ||
dockerfile: Dockerfile | ||
container_name: grafana | ||
restart: unless-stopped | ||
environment: | ||
# - GF_SERVER_ROOT_URL=http://my.grafana.server/ | ||
- GF_INSTALL_PLUGINS=grafana-clock-panel | ||
ports: | ||
- '3000:3000' | ||
volumes: | ||
- 'grafana_storage:/var/lib/grafana' | ||
networks: | ||
- monitoring | ||
|
||
node-exporter: | ||
image: prom/node-exporter:latest | ||
container_name: node-exporter | ||
restart: unless-stopped | ||
volumes: | ||
- /proc:/host/proc:ro | ||
- /sys:/host/sys:ro | ||
- /:/rootfs:ro | ||
command: | ||
- '--path.procfs=/host/proc' | ||
- '--path.rootfs=/rootfs' | ||
- '--path.sysfs=/host/sys' | ||
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)' | ||
expose: | ||
- 9100 | ||
ports: | ||
- '9100:9100' | ||
networks: | ||
- monitoring | ||
|
||
prometheus: | ||
image: prom/prometheus:latest | ||
container_name: prometheus | ||
restart: unless-stopped | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
- prometheus_data:/prometheus | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
- '--storage.tsdb.path=/prometheus' | ||
- '--web.console.libraries=/etc/prometheus/console_libraries' | ||
- '--web.console.templates=/etc/prometheus/consoles' | ||
- '--web.enable-lifecycle' | ||
ports: | ||
- '9090:9090' | ||
expose: | ||
- 9090 | ||
networks: | ||
- monitoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '3.8' | ||
networks: | ||
monitoring: | ||
driver: bridge | ||
|
||
volumes: | ||
tapstore: {} | ||
|
||
services: | ||
tapreader: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
# expose: | ||
# - 13337 | ||
# - 5099 | ||
ports: | ||
- '13337:13337' | ||
- '5099:5099' | ||
# networks: | ||
# - monitoring | ||
volumes: | ||
- './tapstore:/home/node/app/tapstore:rw' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM grafana/grafana | ||
|
||
# ENV GF_AUTH_DISABLE_LOGIN_FORM "true" | ||
# ENV GF_AUTH_ANONYMOUS_ENABLED "true" | ||
# ENV GF_AUTH_ANONYMOUS_ORG ROLE "Admin" | ||
|
||
#Adding all the files to docker container. | ||
ADD provisioning /etc/grafana/provisioning | ||
ADD config.ini /etc/grafana/config.ini | ||
|
||
# Adding all the dashboard files (JSON) to docker container | ||
ADD dashboards /var/lib/grafana/dashboards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[paths] | ||
provisioning = /etc/grafana/provisioning | ||
[server] | ||
enable_gzip = true | ||
[users] | ||
default_theme = dark |
Oops, something went wrong.