Skip to content

Commit

Permalink
Tested, approved and trusted
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed May 23, 2024
1 parent 73fb32f commit 333290d
Show file tree
Hide file tree
Showing 147 changed files with 17,643 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
KEYDB_PASSWORD=jgsay7f2fgfgda6acCa7g()jaba51!
POSTGRES_USER=sitespeedio
POSTGRES_PASSWORD=jhde7gFArda33Saa1!4dd2dagJ
POSTGRES_DB=sitespeedio
MINIO_ROOT_USER=sitespeedio
MINIO_ROOT_PASSWORD=tracksofmytears
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
sitespeed-result/
.DS_Store
49 changes: 49 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
services:
keydb:
image: eqalpha/keydb:latest
hostname: keydb
ports:
- "6379:6379"
environment:
- KEYDB_PASSWORD=${KEYDB_PASSWORD}
restart: always
postgresql:
image: postgres:16.2
hostname: postgresql
ports:
- "5432:5432"
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=sitespeedio
volumes:
- ./server/database/setup/:/docker-entrypoint-initdb.d
- postgres-data:/var/lib/postgresql/data
minio:
image: minio/minio:RELEASE.2024-05-10T01-41-38Z
volumes:
- minio-data:/data
ports:
- "9000:9000"
- "9001:9001"
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD}
command: server /data --console-address ":9001"
mc:
image: minio/mc:RELEASE.2024-05-09T17-04-24Z
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set sitespeedio http://minio:9000 sitespeedio tracksofmytears &&
(/usr/bin/mc mb --region --region=motown sitespeedio/sitespeedio || echo 'Bucket already exists') &&
/usr/bin/mc ilm rule add --expire-days 30 sitespeedio/sitespeedio &&
/usr/bin/mc anonymous set public myminio/sitespeedio &&
/usr/bin/mc admin config set sitespeedio compression extensions=".html,.css,.js" &&
echo 'MinIO and lifecycle policy setup complete.'"
environment:
MC_HOST_myminio: http://sitespeedio:tracksofmytears@minio:9000
volumes:
postgres-data:
minio-data:
1 change: 1 addition & 0 deletions server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 2 additions & 0 deletions server/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config/*
public/**
27 changes: 27 additions & 0 deletions server/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"root": true,
"env": {
"node": true,
"es2022": true
},
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["prettier", "unicorn"],
"extends": ["eslint:recommended", "plugin:unicorn/recommended"],
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid",
"embeddedLanguageFormatting": "off"
}
],
"require-atomic-updates": 0,
"no-extra-semi": 0,
"no-mixed-spaces-and-tabs": 0
}
}
9 changes: 9 additions & 0 deletions server/.pug-lintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "clock",
"validateExtensions": null,
"validateIndentation": null,
"disallowIdLiterals": null,
"disallowAttributeInterpolation": null,
"validateAttributeSeparator": " ",
"requireLineFeedAtFileEnd": null
}
19 changes: 19 additions & 0 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:20-slim

WORKDIR /usr/src/app

COPY package.json npm-shrinkwrap.json ./

RUN npm ci --omit=dev

COPY . .

RUN useradd --user-group --create-home --shell /bin/false sitespeed && \
chown -R sitespeed:sitespeed /usr/src/app

USER sitespeed

EXPOSE 3000

ENTRYPOINT ["node", "app.js"]
CMD []
Loading

0 comments on commit 333290d

Please sign in to comment.