clean up docker files
This commit is contained in:
1 parent
62031a0ab1
commit
dffce2709e
61 files changed
+15
-1728
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]=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;"]
|
||||
@@ -1,29 +1,14 @@
|
||||
# Dev/Test only: Not required in production
|
||||
# Example Docker Compose configuration for custom CA trust
|
||||
# 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:
|
||||
server:
|
||||
image: uptime_server:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "52345:52345"
|
||||
env_file:
|
||||
- server.env
|
||||
checkmate:
|
||||
environment:
|
||||
# Mount your custom CA certificate
|
||||
NODE_EXTRA_CA_CERTS: /certs/custom-ca.pem
|
||||
volumes:
|
||||
# Mount the certs directory (read-only for security)
|
||||
- ./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:
|
||||
client:
|
||||
image: uptime_client:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "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
|
||||
checkmate:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: docker/Dockerfile
|
||||
restart: always
|
||||
ports:
|
||||
- "52345:52345"
|
||||
env_file:
|
||||
- server.env
|
||||
depends_on:
|
||||
- mongodb
|
||||
mongodb:
|
||||
condition: service_healthy
|
||||
worker:
|
||||
image: uptime_server:latest
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: docker/Dockerfile
|
||||
restart: always
|
||||
ports:
|
||||
- "52346:52346"
|
||||
@@ -43,9 +36,10 @@ services:
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
depends_on:
|
||||
- mongodb
|
||||
mongodb:
|
||||
condition: service_healthy
|
||||
mongodb:
|
||||
image: uptime_mongo:latest
|
||||
image: mongo:8.0
|
||||
restart: always
|
||||
ports:
|
||||
- "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"]
|
||||
Reference in new issue
Block a user