clean up docker files
This commit is contained in:
1 parent
62031a0ab1
commit
dffce2709e
61 files changed
+14
-1727
No files matched your search
@@ -1,33 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
REM Change directory to root Server directory for correct Docker Context
|
|
||||||
cd /d "%~dp0"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
REM Define service names and their corresponding Dockerfiles
|
|
||||||
set services[0]=bluewaveuptime/uptime_client
|
|
||||||
set dockerfiles[0]=.\docker\coolify\client.Dockerfile
|
|
||||||
|
|
||||||
set services[1]=bluewaveuptime/uptime_database_mongo
|
|
||||||
set dockerfiles[1]=.\docker\coolify\mongoDB.Dockerfile
|
|
||||||
|
|
||||||
set services[2]=bluewaveuptime/uptime_server
|
|
||||||
set dockerfiles[2]=.\docker\coolify\server.Dockerfile
|
|
||||||
|
|
||||||
REM Loop through each service and build the corresponding image
|
|
||||||
for /L %%i in (0,1,2) do (
|
|
||||||
set service=!services[%%i]!
|
|
||||||
set dockerfile=!dockerfiles[%%i]!
|
|
||||||
|
|
||||||
docker build -f "!dockerfile!" -t "!service!" .
|
|
||||||
|
|
||||||
REM Check if the build succeeded
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error building !service! image. Exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo All images built successfully
|
|
||||||
exit /b 0
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Change directory to root Server directory for correct Docker Context
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
cd ../../
|
|
||||||
|
|
||||||
# Define an array of services and their Dockerfiles
|
|
||||||
declare -A services=(
|
|
||||||
["bluewaveuptime/uptime_client"]="./docker/coolify/client.Dockerfile"
|
|
||||||
["bluewaveuptime/uptime_database_mongo"]="./docker/coolify/mongoDB.Dockerfile"
|
|
||||||
["bluewaveuptime/uptime_server"]="./docker/coolify/server.Dockerfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Loop through each service and build the corresponding image
|
|
||||||
for service in "${!services[@]}"; do
|
|
||||||
docker build -f "${services[$service]}" -t "$service" .
|
|
||||||
|
|
||||||
# Check if the build succeeded
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Error building $service image. Exiting..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "All images built successfully"
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
FROM node:20-slim AS build
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./client/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./client .
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx:1.27.1-alpine
|
|
||||||
|
|
||||||
COPY ./server/docker/dist/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
COPY --from=build /app/env.sh /docker-entrypoint.d/env.sh
|
|
||||||
RUN chmod +x /docker-entrypoint.d/env.sh
|
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM mongo
|
|
||||||
EXPOSE 27017
|
|
||||||
CMD ["mongod"]
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name checkmate-demo.bluewavelabs.ca;
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
|
||||||
root /var/www/certbot;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://server:5000/api/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api-docs/ {
|
|
||||||
proxy_pass http://server:5000/api-docs/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
FROM node:22-slim
|
|
||||||
|
|
||||||
# Install ping
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y iputils-ping \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ../../package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ../../ ./
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
EXPOSE 5000
|
|
||||||
|
|
||||||
CMD ["node", "dist/index.js"]
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
REM Change directory to root Server directory for correct Docker Context
|
|
||||||
cd /d "%~dp0"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
REM Define service names and their corresponding Dockerfiles
|
|
||||||
set services[0]=uptime_client
|
|
||||||
set dockerfiles[0]=.\docker\dev\client.Dockerfile
|
|
||||||
|
|
||||||
set services[1]=uptime_mongo
|
|
||||||
set dockerfiles[1]=.\docker\dev\mongoDB.Dockerfile
|
|
||||||
|
|
||||||
set services[2]=uptime_server
|
|
||||||
set dockerfiles[2]=.\docker\dev\server.Dockerfile
|
|
||||||
|
|
||||||
REM Loop through each service and build the corresponding image
|
|
||||||
for /L %%i in (0,1,2) do (
|
|
||||||
set service=!services[%%i]!
|
|
||||||
set dockerfile=!dockerfiles[%%i]!
|
|
||||||
|
|
||||||
docker build -f "!dockerfile!" -t "!service!" .
|
|
||||||
|
|
||||||
REM Check if the build succeeded
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error building !service! image. Exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo All images built successfully
|
|
||||||
exit /b 0
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Change directory to root Server directory for correct Docker Context
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
# Define service names and their corresponding Dockerfiles in parallel arrays
|
|
||||||
services=("uptime_client" "uptime_mongo" "uptime_server")
|
|
||||||
dockerfiles=(
|
|
||||||
"./docker/dev/client.Dockerfile"
|
|
||||||
"./docker/dev/mongoDB.Dockerfile"
|
|
||||||
"./docker/dev/server.Dockerfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Loop through each service and build the corresponding image
|
|
||||||
for i in "${!services[@]}"; do
|
|
||||||
service="${services[$i]}"
|
|
||||||
dockerfile="${dockerfiles[$i]}"
|
|
||||||
|
|
||||||
docker build -f "$dockerfile" -t "$service" .
|
|
||||||
|
|
||||||
# Check if the build succeeded
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Error building $service image. Exiting..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "All images built successfully"
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
FROM node:20-slim AS build
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./client/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./client ./
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx:1.27.1-alpine
|
|
||||||
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
COPY --from=build /app/env.sh /docker-entrypoint.d/env.sh
|
|
||||||
RUN chmod +x /docker-entrypoint.d/env.sh
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
@@ -2,28 +2,13 @@
|
|||||||
# Example Docker Compose configuration for custom CA trust
|
# Example Docker Compose configuration for custom CA trust
|
||||||
# This file demonstrates how to configure Checkmate to trust custom CAs
|
# This file demonstrates how to configure Checkmate to trust custom CAs
|
||||||
#
|
#
|
||||||
# Usage: docker-compose -f docker-compose.yaml -f docker-compose.custom-ca-example.yaml up
|
# Usage: docker compose -f docker-compose.yaml -f docker-compose.custom-ca-example.yaml up
|
||||||
|
|
||||||
services:
|
services:
|
||||||
server:
|
checkmate:
|
||||||
image: uptime_server:latest
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "52345:52345"
|
|
||||||
env_file:
|
|
||||||
- server.env
|
|
||||||
environment:
|
environment:
|
||||||
# Mount your custom CA certificate
|
# Mount your custom CA certificate
|
||||||
NODE_EXTRA_CA_CERTS: /certs/custom-ca.pem
|
NODE_EXTRA_CA_CERTS: /certs/custom-ca.pem
|
||||||
volumes:
|
volumes:
|
||||||
# Mount the certs directory (read-only for security)
|
# Mount the certs directory (read-only for security)
|
||||||
- ./certs:/certs:ro
|
- ./certs:/certs:ro
|
||||||
depends_on:
|
|
||||||
- mongodb
|
|
||||||
# Optional: Add healthcheck to ensure the server starts properly
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:52345/api/v1/health"]
|
|
||||||
interval: 30s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 3
|
|
||||||
start_period: 40s
|
|
||||||
@@ -1,27 +1,20 @@
|
|||||||
services:
|
services:
|
||||||
client:
|
checkmate:
|
||||||
image: uptime_client:latest
|
build:
|
||||||
restart: always
|
context: ../..
|
||||||
ports:
|
dockerfile: docker/Dockerfile
|
||||||
- "80:80"
|
|
||||||
environment:
|
|
||||||
UPTIME_APP_API_BASE_URL: "http://localhost:52345/api/v1"
|
|
||||||
UPTIME_APP_CLIENT_HOST: "http://localhost"
|
|
||||||
volumes:
|
|
||||||
- ./nginx/conf.d:/etc/nginx/conf.d/
|
|
||||||
depends_on:
|
|
||||||
- server
|
|
||||||
server:
|
|
||||||
image: uptime_server:latest
|
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "52345:52345"
|
- "52345:52345"
|
||||||
env_file:
|
env_file:
|
||||||
- server.env
|
- server.env
|
||||||
depends_on:
|
depends_on:
|
||||||
- mongodb
|
mongodb:
|
||||||
|
condition: service_healthy
|
||||||
worker:
|
worker:
|
||||||
image: uptime_server:latest
|
build:
|
||||||
|
context: ../..
|
||||||
|
dockerfile: docker/Dockerfile
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "52346:52346"
|
- "52346:52346"
|
||||||
@@ -43,9 +36,10 @@ services:
|
|||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 3
|
retries: 3
|
||||||
depends_on:
|
depends_on:
|
||||||
- mongodb
|
mongodb:
|
||||||
|
condition: service_healthy
|
||||||
mongodb:
|
mongodb:
|
||||||
image: uptime_mongo:latest
|
image: mongo:8.0
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "27017:27017"
|
- "27017:27017"
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM mongo
|
|
||||||
EXPOSE 27017
|
|
||||||
CMD ["mongod"]
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80 default_server;
|
|
||||||
listen [::]:80 default_server;
|
|
||||||
|
|
||||||
server_name localhost; # Set server name to localhost
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# location /api/ {
|
|
||||||
# proxy_pass http://server:52345/api/;
|
|
||||||
# proxy_http_version 1.1;
|
|
||||||
# proxy_set_header Host $host;
|
|
||||||
# proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
# proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
# proxy_set_header Connection '';
|
|
||||||
# chunked_transfer_encoding off;
|
|
||||||
# proxy_buffering off;
|
|
||||||
# proxy_cache off;
|
|
||||||
# }
|
|
||||||
|
|
||||||
# location /api-docs/ {
|
|
||||||
# proxy_pass http://server:52345/api-docs/;
|
|
||||||
# proxy_http_version 1.1;
|
|
||||||
# proxy_set_header Host $host;
|
|
||||||
# proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
# proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
# }
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
FROM node:22-slim
|
|
||||||
|
|
||||||
# Install ping
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y iputils-ping \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./server/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./server/ ./
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
EXPOSE 52345
|
|
||||||
|
|
||||||
CMD ["node", "dist/index.js"]
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e # Exit on error
|
|
||||||
|
|
||||||
# Change directory to root Server directory for correct Docker Context
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
# Ensure buildx builder exists and is used
|
|
||||||
if ! docker buildx inspect mybuilder &>/dev/null; then
|
|
||||||
docker buildx create --name mybuilder --use
|
|
||||||
else
|
|
||||||
docker buildx use mybuilder
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Define service names and Dockerfiles
|
|
||||||
services=("mono_server_arm")
|
|
||||||
dockerfiles=(
|
|
||||||
"./docker/dist-arm/server.Dockerfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Static image name for GitHub Container Registry (GHCR)
|
|
||||||
image="ghcr.io/bluewave-labs/checkmate:backend-dist-multi-arch"
|
|
||||||
platforms="linux/amd64,linux/arm64"
|
|
||||||
repo_url="https://github.com/bluewave-labs/checkmate"
|
|
||||||
|
|
||||||
# Loop through each service and build
|
|
||||||
for i in "${!services[@]}"; do
|
|
||||||
service="${services[$i]}"
|
|
||||||
dockerfile="${dockerfiles[$i]}"
|
|
||||||
|
|
||||||
echo "🚀 Building multi-arch image for $service..."
|
|
||||||
docker buildx build \
|
|
||||||
--platform "$platforms" \
|
|
||||||
-f "$dockerfile" \
|
|
||||||
-t "$image" \
|
|
||||||
--label "org.opencontainers.image.source=$repo_url" \
|
|
||||||
--push \
|
|
||||||
.
|
|
||||||
|
|
||||||
echo "✅ $image pushed for platforms: $platforms"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "🎉 All multi-arch images built and pushed successfully"
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
services:
|
|
||||||
server:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate-backend-mono-multiarch:latest
|
|
||||||
restart: always
|
|
||||||
pull_policy: always
|
|
||||||
ports:
|
|
||||||
- "52345:52345"
|
|
||||||
environment:
|
|
||||||
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
|
|
||||||
- UPTIME_APP_CLIENT_HOST=http://localhost
|
|
||||||
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db
|
|
||||||
- CLIENT_HOST=http://localhost
|
|
||||||
- JWT_SECRET=my_secret
|
|
||||||
depends_on:
|
|
||||||
- mongodb
|
|
||||||
mongodb:
|
|
||||||
image: mongo:6.0
|
|
||||||
restart: always
|
|
||||||
command: ["mongod", "--quiet", "--bind_ip_all"]
|
|
||||||
volumes:
|
|
||||||
- ./mongo/data:/data/db
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mongosh", "--eval", "db.runCommand({ ping: 1 })", "--quiet"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 30s
|
|
||||||
start_period: 0s
|
|
||||||
start_interval: 1s
|
|
||||||
retries: 30
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
# ---------------------
|
|
||||||
# Frontend build stage
|
|
||||||
# ---------------------
|
|
||||||
# Build on the host arch (BUILDPLATFORM) rather than under QEMU — the output is
|
|
||||||
# pure JS so it's arch-independent, and this avoids the esbuild host/native
|
|
||||||
# binary version mismatch under emulation.
|
|
||||||
FROM --platform=$BUILDPLATFORM node:20-slim AS frontend-build
|
|
||||||
|
|
||||||
WORKDIR /app/client
|
|
||||||
|
|
||||||
COPY client/package*.json ./
|
|
||||||
|
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
COPY client ./
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# ---------------------
|
|
||||||
# Backend stage
|
|
||||||
# ---------------------
|
|
||||||
FROM node:22-slim AS backend
|
|
||||||
|
|
||||||
# Install ping
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y iputils-ping \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
WORKDIR /app/server
|
|
||||||
|
|
||||||
COPY server/package.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY server ./
|
|
||||||
|
|
||||||
RUN chmod +x ./scripts/inject-vars.sh
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
COPY --from=frontend-build /app/client/dist ./public
|
|
||||||
|
|
||||||
RUN chown -R node:node ./public \
|
|
||||||
&& chown -R node:node ./dist \
|
|
||||||
&& chown -R node:node ./scripts
|
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 52345
|
|
||||||
|
|
||||||
CMD ["sh", "-c", "./scripts/inject-vars.sh && node ./dist/index.js"]
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
REM Change directory to root Server directory for correct Docker Context
|
|
||||||
cd /d "%~dp0"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
REM Define service names and their corresponding Dockerfiles
|
|
||||||
set services[0]=uptime_database_mongo
|
|
||||||
set dockerfiles[0]=.\docker\dist-mono\mongoDB.Dockerfile
|
|
||||||
|
|
||||||
set services[1]=uptime_server
|
|
||||||
set dockerfiles[1]=.\docker\dist-mono\server.Dockerfile
|
|
||||||
|
|
||||||
REM Loop through each service and build the corresponding image
|
|
||||||
for /L %%i in (0,1) do (
|
|
||||||
set service=!services[%%i]!
|
|
||||||
set dockerfile=!dockerfiles[%%i]!
|
|
||||||
|
|
||||||
docker build -f "!dockerfile!" -t "!service!" .
|
|
||||||
|
|
||||||
REM Check if the build succeeded
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error building !service! image. Exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo All images built successfully
|
|
||||||
exit /b 0
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Change directory to root Server directory for correct Docker Context
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
# Define service names and their corresponding Dockerfiles in parallel arrays
|
|
||||||
services=("mono_mongo" "mono_server")
|
|
||||||
dockerfiles=(
|
|
||||||
"./docker/dist-mono/mongoDB.Dockerfile"
|
|
||||||
"./docker/dist-mono/server.Dockerfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Loop through each service and build the corresponding image
|
|
||||||
for i in "${!services[@]}"; do
|
|
||||||
service="${services[$i]}"
|
|
||||||
dockerfile="${dockerfiles[$i]}"
|
|
||||||
|
|
||||||
docker build -f "$dockerfile" -t "$service" .
|
|
||||||
|
|
||||||
# Check if the build succeeded
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Error building $service image. Exiting..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "All images built successfully"
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
services:
|
|
||||||
server:
|
|
||||||
image: mono_server
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "52345:52345"
|
|
||||||
environment:
|
|
||||||
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
|
|
||||||
- UPTIME_APP_CLIENT_HOST=http://localhost
|
|
||||||
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db
|
|
||||||
- CLIENT_HOST=http://localhost
|
|
||||||
- JWT_SECRET=my_secret
|
|
||||||
depends_on:
|
|
||||||
- mongodb
|
|
||||||
mongodb:
|
|
||||||
image: mono_mongo
|
|
||||||
restart: always
|
|
||||||
command: ["mongod", "--quiet", "--bind_ip_all"]
|
|
||||||
volumes:
|
|
||||||
- ./mongo/data:/data/db
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 30s
|
|
||||||
start_period: 0s
|
|
||||||
start_interval: 1s
|
|
||||||
retries: 30
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
services:
|
|
||||||
server:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate-backend-mono:latest
|
|
||||||
pull_policy: always
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "52345:52345"
|
|
||||||
environment:
|
|
||||||
- UPTIME_APP_API_BASE_URL=http://localhost:52345/api/v1
|
|
||||||
- UPTIME_APP_CLIENT_HOST=http://localhost
|
|
||||||
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db
|
|
||||||
- CLIENT_HOST=http://localhost
|
|
||||||
- JWT_SECRET=my_secret
|
|
||||||
depends_on:
|
|
||||||
- mongodb
|
|
||||||
mongodb:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate-mongo:latest
|
|
||||||
restart: always
|
|
||||||
command: ["mongod", "--quiet", "--bind_ip_all"]
|
|
||||||
volumes:
|
|
||||||
- ./mongo/data:/data/db
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 30s
|
|
||||||
start_period: 0s
|
|
||||||
start_interval: 1s
|
|
||||||
retries: 30
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM mongo
|
|
||||||
EXPOSE 27017
|
|
||||||
CMD ["mongod"]
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
FROM node:22-slim AS frontend-build
|
|
||||||
|
|
||||||
WORKDIR /app/client
|
|
||||||
|
|
||||||
COPY client/package*.json ./
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY client ./
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM node:22-slim AS app
|
|
||||||
|
|
||||||
# Install ping
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y iputils-ping \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
WORKDIR /app/server
|
|
||||||
|
|
||||||
COPY server ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
RUN cp -r src/templates dist/templates
|
|
||||||
|
|
||||||
COPY --from=frontend-build /app/client/dist ./public
|
|
||||||
|
|
||||||
RUN chmod +x ./scripts/inject-vars.sh \
|
|
||||||
&& chown -R node:node ./public \
|
|
||||||
&& chown -R node:node ./dist \
|
|
||||||
&& chown -R node:node ./scripts
|
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 52345
|
|
||||||
|
|
||||||
CMD ["sh", "-c", "./scripts/inject-vars.sh && node ./dist/index.js"]
|
|
||||||
Vendored
-33
@@ -1,33 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
REM Change directory to root Server directory for correct Docker Context
|
|
||||||
cd /d "%~dp0"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
REM Define service names and their corresponding Dockerfiles
|
|
||||||
set services[0]=bluewaveuptime/uptime_client
|
|
||||||
set dockerfiles[0]=.\docker\dist\client.Dockerfile
|
|
||||||
|
|
||||||
set services[1]=bluewaveuptime/uptime_database_mongo
|
|
||||||
set dockerfiles[1]=.\docker\dist\mongoDB.Dockerfile
|
|
||||||
|
|
||||||
set services[2]=bluewaveuptime/uptime_server
|
|
||||||
set dockerfiles[2]=.\docker\dist\server.Dockerfile
|
|
||||||
|
|
||||||
REM Loop through each service and build the corresponding image
|
|
||||||
for /L %%i in (0,1,2) do (
|
|
||||||
set service=!services[%%i]!
|
|
||||||
set dockerfile=!dockerfiles[%%i]!
|
|
||||||
|
|
||||||
docker build -f "!dockerfile!" -t "!service!" .
|
|
||||||
|
|
||||||
REM Check if the build succeeded
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error building !service! image. Exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo All images built successfully
|
|
||||||
exit /b 0
|
|
||||||
Vendored
-25
@@ -1,25 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Change directory to root Server directory for correct Docker Context
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
cd ../../
|
|
||||||
|
|
||||||
# Define an array of services and their Dockerfiles
|
|
||||||
declare -A services=(
|
|
||||||
["bluewaveuptime/uptime_client"]="./docker/dist/client.Dockerfile"
|
|
||||||
["bluewaveuptime/uptime_database_mongo"]="./docker/dist/mongoDB.Dockerfile"
|
|
||||||
["bluewaveuptime/uptime_server"]="./docker/dist/server.Dockerfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
for service in "${!services[@]}"; do
|
|
||||||
docker build \
|
|
||||||
-f "${services[$service]}" \
|
|
||||||
-t "$service" \
|
|
||||||
.
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Error building $service image. Exiting..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "All images built successfully"
|
|
||||||
Vendored
-22
@@ -1,22 +0,0 @@
|
|||||||
FROM node:20-slim AS build
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./client/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./client .
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx:1.27.1-alpine
|
|
||||||
|
|
||||||
COPY ./docker/dist/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
COPY --from=build /app/env.sh /docker-entrypoint.d/env.sh
|
|
||||||
RUN chmod +x /docker-entrypoint.d/env.sh
|
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
Vendored
-38
@@ -1,38 +0,0 @@
|
|||||||
services:
|
|
||||||
client:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate-client:latest
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
UPTIME_APP_API_BASE_URL: "http://localhost:52345/api/v1"
|
|
||||||
UPTIME_APP_CLIENT_HOST: "http://localhost"
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
|
||||||
depends_on:
|
|
||||||
- server
|
|
||||||
server:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate-backend:latest
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "52345:52345"
|
|
||||||
depends_on:
|
|
||||||
- mongodb
|
|
||||||
environment:
|
|
||||||
- DB_CONNECTION_STRING=mongodb://mongodb:27017/uptime_db
|
|
||||||
- CLIENT_HOST=http://localhost
|
|
||||||
- JWT_SECRET=my_secret
|
|
||||||
# volumes:
|
|
||||||
# - /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
mongodb:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate-mongo:latest
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- ./mongo/data:/data/db
|
|
||||||
command: ["mongod", "--quiet", "--bind_ip_all"]
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 30s
|
|
||||||
start_period: 0s
|
|
||||||
start_interval: 1s
|
|
||||||
retries: 30
|
|
||||||
Vendored
-3
@@ -1,3 +0,0 @@
|
|||||||
FROM mongo
|
|
||||||
EXPOSE 27017
|
|
||||||
CMD ["mongod"]
|
|
||||||
-35
@@ -1,35 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name checkmate-demo.bluewavelabs.ca;
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
|
||||||
root /var/www/certbot;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# location /api/ {
|
|
||||||
# proxy_pass http://server:5000/api/;
|
|
||||||
# proxy_http_version 1.1;
|
|
||||||
# proxy_set_header Host $host;
|
|
||||||
# proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
# proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
# }
|
|
||||||
|
|
||||||
location /api-docs/ {
|
|
||||||
proxy_pass http://server:5000/api-docs/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Vendored
-20
@@ -1,20 +0,0 @@
|
|||||||
FROM node:22-slim
|
|
||||||
|
|
||||||
# Install ping
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y iputils-ping \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./server/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./server/ ./
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
EXPOSE 52345
|
|
||||||
|
|
||||||
CMD ["node", "dist/index.js"]
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
REM Change directory to root Server directory for correct Docker Context
|
|
||||||
cd /d "%~dp0"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
REM Define service names and their corresponding Dockerfiles
|
|
||||||
set services[0]=uptime_client
|
|
||||||
set dockerfiles[0]=.\docker\prod\client.Dockerfile
|
|
||||||
|
|
||||||
set services[1]=uptime_database_mongo
|
|
||||||
set dockerfiles[1]=.\docker\prod\mongoDB.Dockerfile
|
|
||||||
|
|
||||||
set services[2]=uptime_server
|
|
||||||
set dockerfiles[2]=.\docker\prod\server.Dockerfile
|
|
||||||
|
|
||||||
REM Loop through each service and build the corresponding image
|
|
||||||
for /L %%i in (0,1,2) do (
|
|
||||||
set service=!services[%%i]!
|
|
||||||
set dockerfile=!dockerfiles[%%i]!
|
|
||||||
|
|
||||||
docker build -f "!dockerfile!" -t "!service!" .
|
|
||||||
|
|
||||||
REM Check if the build succeeded
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error building !service! image. Exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo All images built successfully
|
|
||||||
exit /b 0
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Change directory to root directory for correct Docker Context
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
cd ../../
|
|
||||||
|
|
||||||
# Define an array of services and their Dockerfiles
|
|
||||||
declare -A services=(
|
|
||||||
["uptime_client"]="./docker/prod/client.Dockerfile"
|
|
||||||
["uptime_database_mongo"]="./docker/prod/mongoDB.Dockerfile"
|
|
||||||
["uptime_server"]="./docker/prod/server.Dockerfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Loop through each service and build the corresponding image
|
|
||||||
for service in "${!services[@]}"; do
|
|
||||||
docker build -f "${services[$service]}" -t "$service" .
|
|
||||||
|
|
||||||
# Check if the build succeeded
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Error building $service image. Exiting..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "All images built successfully"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
webserver:
|
|
||||||
image: nginx:latest
|
|
||||||
ports:
|
|
||||||
- 80:80
|
|
||||||
- 443:443
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- ./nginx/conf.d/:/etc/nginx/conf.d/:ro
|
|
||||||
- ./certbot/www/:/var/www/certbot/:ro
|
|
||||||
certbot:
|
|
||||||
image: certbot/certbot:latest
|
|
||||||
volumes:
|
|
||||||
- ./certbot/www/:/var/www/certbot/:rw
|
|
||||||
- ./certbot/conf/:/etc/letsencrypt/:rw
|
|
||||||
depends_on:
|
|
||||||
- webserver
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
FROM node:20-slim AS build
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./client/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./client .
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx:1.27.1-alpine
|
|
||||||
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
COPY --from=build /app/env.sh /docker-entrypoint.d/env.sh
|
|
||||||
RUN chmod +x /docker-entrypoint.d/env.sh
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
services:
|
|
||||||
client:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:frontend-demo
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
UPTIME_APP_API_BASE_URL: "https://demo.checkmate.so/api/v1"
|
|
||||||
UPTIME_APP_CLIENT_HOST: "https://demo.checkmate.so"
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
|
||||||
depends_on:
|
|
||||||
- server
|
|
||||||
volumes:
|
|
||||||
- ./nginx/conf.d:/etc/nginx/conf.d/:ro
|
|
||||||
- /etc/letsencrypt:/etc/nginx/ssl:ro
|
|
||||||
|
|
||||||
server:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:backend-demo
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "52345:52345"
|
|
||||||
env_file:
|
|
||||||
- server.env
|
|
||||||
depends_on:
|
|
||||||
- mongodb
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
mongodb:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:mongo-demo
|
|
||||||
restart: always
|
|
||||||
command: ["mongod", "--quiet", "--bind_ip_all"]
|
|
||||||
volumes:
|
|
||||||
- ./mongo/data:/data/db
|
|
||||||
env_file:
|
|
||||||
- mongo.env
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 30s
|
|
||||||
start_period: 0s
|
|
||||||
start_interval: 1s
|
|
||||||
retries: 30
|
|
||||||
capture:
|
|
||||||
image: ghcr.io/bluewave-labs/capture:latest
|
|
||||||
container_name: capture
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "59232:59232"
|
|
||||||
environment:
|
|
||||||
- API_SECRET=my_secret
|
|
||||||
- GIN_MODE=release
|
|
||||||
volumes:
|
|
||||||
- /etc/os-release:/etc/os-release:ro
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
function initiateReplicaSet() {
|
|
||||||
try {
|
|
||||||
rs.initiate({
|
|
||||||
_id: "rs0",
|
|
||||||
members: [{ _id: 0, host: "localhost:27017" }],
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
print("Replica set already initiated or error occurred: " + e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function waitForPrimary() {
|
|
||||||
while (true) {
|
|
||||||
const isMaster = db.isMaster();
|
|
||||||
if (isMaster.ismaster) {
|
|
||||||
print("This node is now PRIMARY.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
print("Waiting to become PRIMARY...");
|
|
||||||
sleep(2000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function createUser() {
|
|
||||||
db = db.getSiblingDB("uptime_db");
|
|
||||||
|
|
||||||
var username = process.env.USERNAME_ENV_VAR;
|
|
||||||
var password = process.env.PASSWORD_ENV_VAR;
|
|
||||||
|
|
||||||
db.createUser({
|
|
||||||
user: username,
|
|
||||||
pwd: password,
|
|
||||||
roles: [{ role: "readWrite", db: "uptime_db" }],
|
|
||||||
});
|
|
||||||
|
|
||||||
print("User '" + username + "' created successfully");
|
|
||||||
}
|
|
||||||
|
|
||||||
initiateReplicaSet();
|
|
||||||
waitForPrimary();
|
|
||||||
createUser();
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM mongo
|
|
||||||
EXPOSE 27017
|
|
||||||
CMD ["mongod"]
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name checkmate-demo.bluewavelabs.ca www.checkmate-demo.bluewavelabs.ca;
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
|
||||||
root /var/www/certbot;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
return 301 https://[domain-name]$request_uri;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name checkmate-demo.bluewavelabs.ca;
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
|
||||||
root /var/www/certbot;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://server:52345/api/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api-docs/ {
|
|
||||||
proxy_pass http://server:52345/api-docs/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 default_server ssl http2;
|
|
||||||
listen [::]:443 ssl http2;
|
|
||||||
|
|
||||||
server_name checkmate-demo.bluewavelabs.ca;
|
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/ssl/live/demo.checkmate.so/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/nginx/ssl/live/demo.checkmate.so/privkey.pem;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://server:52345/api/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api-docs/ {
|
|
||||||
proxy_pass http://server:52345/api-docs/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
FROM node:22-slim
|
|
||||||
|
|
||||||
# Install ping
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y iputils-ping \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./server/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./server ./
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
RUN cp -r src/templates dist/templates
|
|
||||||
|
|
||||||
EXPOSE 52345
|
|
||||||
|
|
||||||
CMD ["node", "dist/index.js"]
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
REM Change directory to root Server directory for correct Docker Context
|
|
||||||
cd /d "%~dp0"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
REM Define service names and their corresponding Dockerfiles
|
|
||||||
set services[0]=uptime_client
|
|
||||||
set dockerfiles[0]=.\docker\staging\client.Dockerfile
|
|
||||||
|
|
||||||
set services[1]=uptime_database_mongo
|
|
||||||
set dockerfiles[1]=.\docker\staging\mongoDB.Dockerfile
|
|
||||||
|
|
||||||
set services[2]=uptime_server
|
|
||||||
set dockerfiles[2]=.\docker\staging\server.Dockerfile
|
|
||||||
|
|
||||||
REM Loop through each service and build the corresponding image
|
|
||||||
for /L %%i in (0,1,2) do (
|
|
||||||
set service=!services[%%i]!
|
|
||||||
set dockerfile=!dockerfiles[%%i]!
|
|
||||||
|
|
||||||
docker build -f "!dockerfile!" -t "!service!" .
|
|
||||||
|
|
||||||
REM Check if the build succeeded
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error building !service! image. Exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo All images built successfully
|
|
||||||
exit /b 0
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Change directory to root directory for correct Docker Context
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
cd ../../
|
|
||||||
|
|
||||||
# Define an array of services and their Dockerfiles
|
|
||||||
declare -A services=(
|
|
||||||
["uptime_client"]="./docker/staging/client.Dockerfile"
|
|
||||||
["uptime_database_mongo"]="./docker/staging/mongoDB.Dockerfile"
|
|
||||||
["uptime_server"]="./docker/staging/server.Dockerfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Loop through each service and build the corresponding image
|
|
||||||
for service in "${!services[@]}"; do
|
|
||||||
docker build -f "${services[$service]}" -t "$service" .
|
|
||||||
|
|
||||||
# Check if the build succeeded
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Error building $service image. Exiting..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "All images built successfully"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
webserver:
|
|
||||||
image: nginx:latest
|
|
||||||
ports:
|
|
||||||
- 80:80
|
|
||||||
- 443:443
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- ./nginx/conf.d/:/etc/nginx/conf.d/:ro
|
|
||||||
- ./certbot/www/:/var/www/certbot/:ro
|
|
||||||
certbot:
|
|
||||||
image: certbot/certbot:latest
|
|
||||||
volumes:
|
|
||||||
- ./certbot/www/:/var/www/certbot/:rw
|
|
||||||
- ./certbot/conf/:/etc/letsencrypt/:rw
|
|
||||||
depends_on:
|
|
||||||
- webserver
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
FROM node:20-slim AS build
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./client/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./client ./
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx:1.27.1-alpine
|
|
||||||
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
COPY --from=build /app/env.sh /docker-entrypoint.d/env.sh
|
|
||||||
RUN chmod +x /docker-entrypoint.d/env.sh
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
services:
|
|
||||||
client:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:frontend-staging
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
UPTIME_APP_API_BASE_URL: "https://checkmate-test.bluewavelabs.ca/api/v1"
|
|
||||||
UPTIME_APP_CLIENT_HOST: "https://checkmate-test.bluewavelabs.ca"
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
|
||||||
depends_on:
|
|
||||||
- server
|
|
||||||
volumes:
|
|
||||||
- ./nginx/conf.d:/etc/nginx/conf.d/:ro
|
|
||||||
- ./certbot/www:/var/www/certbot/:ro
|
|
||||||
- ./certbot/conf/:/etc/nginx/ssl/:ro
|
|
||||||
|
|
||||||
certbot:
|
|
||||||
image: certbot/certbot:latest
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- ./certbot/www/:/var/www/certbot/:rw
|
|
||||||
- ./certbot/conf/:/etc/letsencrypt/:rw
|
|
||||||
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew --webroot -w /var/www/certbot; sleep 12h & wait $${!}; done;'"
|
|
||||||
|
|
||||||
server:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:backend-staging
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "52345:52345"
|
|
||||||
env_file:
|
|
||||||
- server.env
|
|
||||||
depends_on:
|
|
||||||
- mongodb
|
|
||||||
mongodb:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:mongo-staging
|
|
||||||
restart: always
|
|
||||||
command: ["mongod", "--quiet", "--bind_ip_all"]
|
|
||||||
ports:
|
|
||||||
- "27017:27017"
|
|
||||||
volumes:
|
|
||||||
- ./mongo/data:/data/db
|
|
||||||
env_file:
|
|
||||||
- mongo.env
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 30s
|
|
||||||
start_period: 0s
|
|
||||||
start_interval: 1s
|
|
||||||
retries: 30
|
|
||||||
capture:
|
|
||||||
image: ghcr.io/bluewave-labs/capture:latest
|
|
||||||
container_name: capture
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "59232:59232"
|
|
||||||
environment:
|
|
||||||
- API_SECRET=my_secret
|
|
||||||
- GIN_MODE=release
|
|
||||||
volumes:
|
|
||||||
- /etc/os-release:/etc/os-release:ro
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
try {
|
|
||||||
const status = rs.status();
|
|
||||||
printjson(status);
|
|
||||||
} catch (e) {
|
|
||||||
if (e.codeName === "NotYetInitialized") {
|
|
||||||
print("Replica set not initialized. Initiating...");
|
|
||||||
rs.initiate({
|
|
||||||
_id: "rs0",
|
|
||||||
members: [{ _id: 0, host: "mongodb:27017" }],
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
print("Unexpected error during rs.status():");
|
|
||||||
printjson(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
var username = process.env.USERNAME_ENV_VAR;
|
|
||||||
var password = process.env.PASSWORD_ENV_VAR;
|
|
||||||
|
|
||||||
db = db.getSiblingDB("uptime_db");
|
|
||||||
|
|
||||||
db.createUser({
|
|
||||||
user: username,
|
|
||||||
pwd: password,
|
|
||||||
roles: [
|
|
||||||
{
|
|
||||||
role: "readWrite",
|
|
||||||
db: "uptime_db",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
print("User uptime_user created successfully");
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM mongo
|
|
||||||
EXPOSE 27017
|
|
||||||
CMD ["mongod"]
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name checkmate-test.bluewavelabs.ca www.checkmate-test.bluewavelabs.ca;
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
|
||||||
root /var/www/certbot;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
return 301 https://[domain-name]$request_uri;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name checkmate-test.bluewavelabs.ca;
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
|
||||||
root /var/www/certbot;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://server:52345/api/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header Connection '';
|
|
||||||
chunked_transfer_encoding off;
|
|
||||||
proxy_buffering off;
|
|
||||||
proxy_cache off;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api-docs/ {
|
|
||||||
proxy_pass http://server:52345/api-docs/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 default_server ssl http2;
|
|
||||||
listen [::]:443 ssl http2;
|
|
||||||
|
|
||||||
server_name checkmate-test.bluewavelabs.ca;
|
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/ssl/live/checkmate-test.bluewavelabs.ca/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/nginx/ssl/live/checkmate-test.bluewavelabs.ca/privkey.pem;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://server:52345/api/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
proxy_set_header Connection '';
|
|
||||||
chunked_transfer_encoding off;
|
|
||||||
proxy_buffering off;
|
|
||||||
proxy_cache off;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api-docs/ {
|
|
||||||
proxy_pass http://server:52345/api-docs/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
FROM node:22-slim
|
|
||||||
|
|
||||||
# Install ping
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y iputils-ping \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./server/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./server ./
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
RUN cp -r src/templates dist/templates
|
|
||||||
|
|
||||||
EXPOSE 52345
|
|
||||||
|
|
||||||
CMD ["node", "dist/index.js"]
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
REM Change directory to root Server directory for correct Docker Context
|
|
||||||
cd /d "%~dp0"
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
REM Define service names and their corresponding Dockerfiles
|
|
||||||
set services[0]=uptime_client
|
|
||||||
set dockerfiles[0]=.\docker\unified\client.Dockerfile
|
|
||||||
|
|
||||||
set services[1]=uptime_database_mongo
|
|
||||||
set dockerfiles[1]=.\docker\unified\mongoDB.Dockerfile
|
|
||||||
|
|
||||||
set services[2]=uptime_server
|
|
||||||
set dockerfiles[2]=.\docker\unified\server.Dockerfile
|
|
||||||
|
|
||||||
REM Loop through each service and build the corresponding image
|
|
||||||
for /L %%i in (0,1,2) do (
|
|
||||||
set service=!services[%%i]!
|
|
||||||
set dockerfile=!dockerfiles[%%i]!
|
|
||||||
|
|
||||||
docker build -f "!dockerfile!" -t "!service!" .
|
|
||||||
|
|
||||||
REM Check if the build succeeded
|
|
||||||
if errorlevel 1 (
|
|
||||||
echo Error building !service! image. Exiting...
|
|
||||||
exit /b 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
echo All images built successfully
|
|
||||||
exit /b 0
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Change directory to root directory for correct Docker Context
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
cd ../../
|
|
||||||
|
|
||||||
# Define an array of services and their Dockerfiles
|
|
||||||
declare -A services=(
|
|
||||||
["uptime_client"]="./docker/unified/client.Dockerfile"
|
|
||||||
["uptime_database_mongo"]="./docker/unified/mongoDB.Dockerfile"
|
|
||||||
["uptime_server"]="./docker/unified/server.Dockerfile"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Loop through each service and build the corresponding image
|
|
||||||
for service in "${!services[@]}"; do
|
|
||||||
docker build -f "${services[$service]}" -t "$service" .
|
|
||||||
|
|
||||||
# Check if the build succeeded
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Error building $service image. Exiting..."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "All images built successfully"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
webserver:
|
|
||||||
image: nginx:latest
|
|
||||||
ports:
|
|
||||||
- 80:80
|
|
||||||
- 443:443
|
|
||||||
restart: always
|
|
||||||
volumes:
|
|
||||||
- ./nginx/conf.d/:/etc/nginx/conf.d/:ro
|
|
||||||
- ./certbot/www/:/var/www/certbot/:ro
|
|
||||||
certbot:
|
|
||||||
image: certbot/certbot:latest
|
|
||||||
volumes:
|
|
||||||
- ./certbot/www/:/var/www/certbot/:rw
|
|
||||||
- ./certbot/conf/:/etc/letsencrypt/:rw
|
|
||||||
depends_on:
|
|
||||||
- webserver
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
FROM node:20-slim AS build
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./client/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./client .
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx:1.27.1-alpine
|
|
||||||
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
COPY --from=build /app/env.sh /docker-entrypoint.d/env.sh
|
|
||||||
RUN chmod +x /docker-entrypoint.d/env.sh
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
# sudo certbot certonly --standalone --http-01-port 8080
|
|
||||||
# cerbot needs to run on 8080 since port 80 is used by the gateway
|
|
||||||
|
|
||||||
services:
|
|
||||||
# Gateway (Single Entry Point)
|
|
||||||
gateway:
|
|
||||||
image: nginx:1.27.1-alpine
|
|
||||||
container_name: checkmate-gateway
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
- "443:443"
|
|
||||||
volumes:
|
|
||||||
- /etc/letsencrypt:/etc/nginx/ssl:ro
|
|
||||||
- ./gateway/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
||||||
|
|
||||||
# Production Stack -----
|
|
||||||
client-prod:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:frontend-demo
|
|
||||||
container_name: client-prod
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
UPTIME_APP_API_BASE_URL: "https://demo.checkmate.so/api/v1"
|
|
||||||
UPTIME_APP_CLIENT_HOST: "https://demo.checkmate.so"
|
|
||||||
expose:
|
|
||||||
- "80"
|
|
||||||
depends_on:
|
|
||||||
- server-prod
|
|
||||||
volumes:
|
|
||||||
- ./nginx/conf.d/prod.conf:/etc/nginx/conf.d/default.conf:ro
|
|
||||||
|
|
||||||
server-prod:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:backend-demo
|
|
||||||
container_name: server-prod
|
|
||||||
restart: always
|
|
||||||
env_file:
|
|
||||||
- server-prod.env
|
|
||||||
depends_on:
|
|
||||||
- mongodb-prod
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
|
|
||||||
mongodb-prod:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:mongo-demo
|
|
||||||
container_name: mongodb-prod
|
|
||||||
restart: always
|
|
||||||
command: [ "mongod", "--quiet", "--bind_ip_all" ]
|
|
||||||
volumes:
|
|
||||||
- ./mongo/data-prod:/data/db
|
|
||||||
env_file:
|
|
||||||
- mongo-prod.env
|
|
||||||
healthcheck:
|
|
||||||
test: [ "CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet" ]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 30s
|
|
||||||
start_period: 0s
|
|
||||||
start_interval: 1s
|
|
||||||
retries: 30
|
|
||||||
|
|
||||||
# Staging Stack -----
|
|
||||||
client-staging:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:frontend-staging
|
|
||||||
container_name: client-staging
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
UPTIME_APP_API_BASE_URL: "https://staging.checkmate.so/api/v1"
|
|
||||||
UPTIME_APP_CLIENT_HOST: "https://staging.checkmate.so"
|
|
||||||
expose:
|
|
||||||
- "80"
|
|
||||||
depends_on:
|
|
||||||
- server-staging
|
|
||||||
volumes:
|
|
||||||
- ./nginx/conf.d/staging.conf:/etc/nginx/conf.d/default.conf:ro
|
|
||||||
|
|
||||||
server-staging:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:backend-staging
|
|
||||||
container_name: server-staging
|
|
||||||
restart: always
|
|
||||||
env_file:
|
|
||||||
- server-staging.env
|
|
||||||
depends_on:
|
|
||||||
- mongodb-staging
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
||||||
|
|
||||||
mongodb-staging:
|
|
||||||
image: ghcr.io/bluewave-labs/checkmate:mongo-staging
|
|
||||||
container_name: mongodb-staging
|
|
||||||
restart: always
|
|
||||||
command: [ "mongod", "--quiet", "--bind_ip_all" ]
|
|
||||||
volumes:
|
|
||||||
- ./mongo/data-staging:/data/db
|
|
||||||
env_file:
|
|
||||||
- mongo-staging.env
|
|
||||||
healthcheck:
|
|
||||||
test: [ "CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet" ]
|
|
||||||
interval: 5s
|
|
||||||
timeout: 30s
|
|
||||||
start_period: 0s
|
|
||||||
start_interval: 1s
|
|
||||||
retries: 30
|
|
||||||
|
|
||||||
# Shared Utils
|
|
||||||
capture:
|
|
||||||
image: ghcr.io/bluewave-labs/capture:latest
|
|
||||||
container_name: capture
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "59232:59232"
|
|
||||||
environment:
|
|
||||||
- API_SECRET=my_secret
|
|
||||||
- GIN_MODE=release
|
|
||||||
volumes:
|
|
||||||
- /etc/os-release:/etc/os-release:ro
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name demo.checkmate.so staging.checkmate.so;
|
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
|
||||||
# Forward the challenge to Certbot listening on 8080
|
|
||||||
proxy_pass http://172.17.0.1:8080;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
return 301 https://$host$request_uri;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# --- PRODUCTION: demo.checkmate.so ---
|
|
||||||
server {
|
|
||||||
listen 443 ssl;
|
|
||||||
server_name demo.checkmate.so;
|
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/ssl/live/demo.checkmate.so/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/nginx/ssl/live/demo.checkmate.so/privkey.pem;
|
|
||||||
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
# Passes traffic to the prod client on port 80
|
|
||||||
proxy_pass http://client-prod:80;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# --- STAGING: staging.checkmate.so ---
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 443 ssl;
|
|
||||||
server_name staging.checkmate.so;
|
|
||||||
|
|
||||||
ssl_certificate /etc/nginx/ssl/live/staging.checkmate.so/fullchain.pem;
|
|
||||||
ssl_certificate_key /etc/nginx/ssl/live/staging.checkmate.so/privkey.pem;
|
|
||||||
|
|
||||||
ssl_protocols TLSv1.2 TLSv1.3;
|
|
||||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
# Passes traffic to the staging client on port 80
|
|
||||||
proxy_pass http://client-staging:80;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
FROM mongo
|
|
||||||
EXPOSE 27017
|
|
||||||
CMD ["mongod"]
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name _;
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://server-prod:52345/api/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api-docs/ {
|
|
||||||
proxy_pass http://server-prod:52345/api-docs/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
|
|
||||||
server_name _;
|
|
||||||
server_tokens off;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://server-staging:52345/api/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api-docs/ {
|
|
||||||
proxy_pass http://server-staging:52345/api-docs/;
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
FROM node:22-slim
|
|
||||||
|
|
||||||
# Install ping
|
|
||||||
RUN apt-get update \
|
|
||||||
&& apt-get install -y iputils-ping \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=2048"
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY ./server/package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
COPY ./server ./
|
|
||||||
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
EXPOSE 52345
|
|
||||||
|
|
||||||
CMD ["node", "dist/index.js"]
|
|
||||||
Reference in new issue
Block a user