many changes
This commit is contained in:
parent
6ed21a40cf
commit
2485a85515
@ -1,81 +0,0 @@
|
|||||||
name: "server"
|
|
||||||
|
|
||||||
services:
|
|
||||||
traefik:
|
|
||||||
extends:
|
|
||||||
file: traefik.yml
|
|
||||||
service: traefik
|
|
||||||
networks:
|
|
||||||
- proxynet
|
|
||||||
|
|
||||||
nginx:
|
|
||||||
extends:
|
|
||||||
file: nginx.yml
|
|
||||||
service: nginx
|
|
||||||
networks:
|
|
||||||
- proxynet
|
|
||||||
|
|
||||||
nginx-demo:
|
|
||||||
extends:
|
|
||||||
file: nginx-demo.yml
|
|
||||||
service: nginx-demo
|
|
||||||
networks:
|
|
||||||
- proxynet
|
|
||||||
|
|
||||||
node-demo:
|
|
||||||
extends:
|
|
||||||
file: node-demo.yml
|
|
||||||
service: node-demo
|
|
||||||
networks:
|
|
||||||
- proxynet
|
|
||||||
#- internal
|
|
||||||
|
|
||||||
postgres:
|
|
||||||
extends:
|
|
||||||
file: postgres.yml
|
|
||||||
service: postgres
|
|
||||||
networks:
|
|
||||||
- proxynet
|
|
||||||
#- internal
|
|
||||||
|
|
||||||
pgadmin:
|
|
||||||
extends:
|
|
||||||
file: pgadmin.yml
|
|
||||||
service: pgadmin
|
|
||||||
networks:
|
|
||||||
- proxynet
|
|
||||||
|
|
||||||
gitea:
|
|
||||||
extends:
|
|
||||||
file: gitea.yml
|
|
||||||
service: gitea
|
|
||||||
networks:
|
|
||||||
- proxynet
|
|
||||||
|
|
||||||
gitea-cache:
|
|
||||||
extends:
|
|
||||||
file: gitea-cache.yml
|
|
||||||
service: gitea-cache
|
|
||||||
networks:
|
|
||||||
- proxynet
|
|
||||||
|
|
||||||
initContainers:
|
|
||||||
container_name: volume-permissions
|
|
||||||
image: busybox:1.36.1-glibc
|
|
||||||
|
|
||||||
command: >
|
|
||||||
sh -c "touch /letsencrypt/acme.json &&
|
|
||||||
chmod -Rv 600 /letsencrypt/* &&
|
|
||||||
chown 65532:65532 /letsencrypt/acme.json &&
|
|
||||||
chmod 755 /init-db/init-database.sh"
|
|
||||||
#command: ["sh", "-c", "touch /letsencrypt/acme.json && chmod -Rv 600 /letsencrypt/* && chown 65532:65532 /letsencrypt/acme.json && chmod 755 /init-db/init-database.sh"]
|
|
||||||
volumes:
|
|
||||||
- ./secrets/letsencrypt:/letsencrypt
|
|
||||||
- ./init-db:/init-db
|
|
||||||
|
|
||||||
networks:
|
|
||||||
proxynet:
|
|
||||||
driver: bridge
|
|
||||||
external: false
|
|
||||||
#internal:
|
|
||||||
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
services:
|
|
||||||
gitea-cache:
|
|
||||||
container_name: gitea-cache
|
|
||||||
image: redis:7.2.5-alpine3.20
|
|
||||||
restart: always
|
|
||||||
networks:
|
|
||||||
- proxynet
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "redis-cli", "ping"]
|
|
||||||
interval: 15s
|
|
||||||
timeout: 3s
|
|
||||||
retries: 30
|
|
||||||
logging:
|
|
||||||
driver: "json-file"
|
|
||||||
options:
|
|
||||||
max-size: "1m"
|
|
||||||
17
gitea.yml
17
gitea.yml
@ -17,7 +17,6 @@ services:
|
|||||||
- ROOT_URL=https://gitea.${DOMAIN}
|
- ROOT_URL=https://gitea.${DOMAIN}
|
||||||
- SSH_PORT=222
|
- SSH_PORT=222
|
||||||
- SSH_LISTEN_PORT=22
|
- SSH_LISTEN_PORT=22
|
||||||
#- DB_TYPE=sqlite3
|
|
||||||
- GITEA__cache__ENABLED=true
|
- GITEA__cache__ENABLED=true
|
||||||
- GITEA__cache__ADAPTER=redis
|
- GITEA__cache__ADAPTER=redis
|
||||||
- GITEA__cache__HOST=redis://gitea-cache:6379/0?pool_size=100&idle_timeout=180s
|
- GITEA__cache__HOST=redis://gitea-cache:6379/0?pool_size=100&idle_timeout=180s
|
||||||
@ -55,3 +54,19 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
- "222:22"
|
- "222:22"
|
||||||
|
|
||||||
|
gitea-cache:
|
||||||
|
container_name: gitea-cache
|
||||||
|
image: redis:7.2.5-alpine3.20
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- proxynet
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 15s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 30
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "1m"
|
||||||
19
gitlab.yml
19
gitlab.yml
@ -1,19 +0,0 @@
|
|||||||
services:
|
|
||||||
gitlab:
|
|
||||||
image: gitlab/gitlab-ce:17.1.0-ce.0
|
|
||||||
container_name: gitlab
|
|
||||||
restart: always
|
|
||||||
hostname: 'gitlab.corp.hm'
|
|
||||||
environment:
|
|
||||||
GITLAB_OMNIBUS_CONFIG: |
|
|
||||||
# Add any other gitlab.rb configuration here, each on its own line
|
|
||||||
external_url 'https://gitlab.corp.hm'
|
|
||||||
ports:
|
|
||||||
- '80:80'
|
|
||||||
- '443:443'
|
|
||||||
- '22:22'
|
|
||||||
volumes:
|
|
||||||
- '$GITLAB_HOME/config:/etc/gitlab'
|
|
||||||
- '$GITLAB_HOME/logs:/var/log/gitlab'
|
|
||||||
- '$GITLAB_HOME/data:/var/opt/gitlab'
|
|
||||||
shm_size: '256m'
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
CREATE DATABASE checkers;
|
|
||||||
CREATE USER checkers WITH ENCRYPTED PASSWORD '477iyetc44i2th6za8r7';
|
|
||||||
GRANT ALL PRIVILEGES ON DATABASE checkers TO checkers;
|
|
||||||
@ -13,10 +13,17 @@ services:
|
|||||||
POSTGRES_DB: postgres
|
POSTGRES_DB: postgres
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/pgdata:/var/lib/postgresql/data
|
- ./data/pgdata:/var/lib/postgresql/data
|
||||||
#- ./init-db:/docker-entrypoint-initdb.d
|
|
||||||
- ./init-db/init-database.sh:/docker-entrypoint-initdb.d/init-database.sh
|
- ./init-db/init-database.sh:/docker-entrypoint-initdb.d/init-database.sh
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.tcp.routers.postgresql.rule=HostSNI(`*`)"
|
- "traefik.tcp.routers.postgresql.rule=HostSNI(`*`)"
|
||||||
- "traefik.tcp.services.postgresql.loadbalancer.server.port=5432"
|
- "traefik.tcp.services.postgresql.loadbalancer.server.port=5432"
|
||||||
- "traefik.tcp.routers.postgresql.entrypoints=postgres"
|
- "traefik.tcp.routers.postgresql.entrypoints=postgres"
|
||||||
|
|
||||||
|
initContainers:
|
||||||
|
container_name: volume-permissions
|
||||||
|
image: busybox:1.36.1-glibc
|
||||||
|
command: >
|
||||||
|
sh -c "chmod 755 /init-db/init-database.sh"
|
||||||
|
volumes:
|
||||||
|
- ./init-db:/init-db
|
||||||
64
readme.md
64
readme.md
@ -1 +1,63 @@
|
|||||||
Srerver Docker Config
|
Init:
|
||||||
|
|
||||||
|
sudo git clone git@rozenlab.com:leo/repo-server.git && sudo docker network create proxynet && sudo chmod +x ./repo-server/start.sh
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
All run:
|
||||||
|
|
||||||
|
sudo ./start.sh
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
Traefik run:
|
||||||
|
|
||||||
|
Development:
|
||||||
|
sudo docker compose --env-file .env.dev -f traefik.yml up -d
|
||||||
|
|
||||||
|
Production:
|
||||||
|
sudo docker compose --env-file .env.prod -f traefik.yml up -d
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
Gitea run:
|
||||||
|
|
||||||
|
Development:
|
||||||
|
sudo docker compose --env-file .env.dev -f gitea.yml up -d
|
||||||
|
|
||||||
|
Production:
|
||||||
|
sudo docker compose --env-file .env.prod -f gitea.yml up -d
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
Postgres run:
|
||||||
|
|
||||||
|
Development:
|
||||||
|
sudo docker compose -f postgres.yml up -d
|
||||||
|
|
||||||
|
Production:
|
||||||
|
sudo docker compose -f postgres.yml up -d
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
Pgadmin run:
|
||||||
|
|
||||||
|
Development:
|
||||||
|
sudo docker compose --env-file .env.dev -f pgadmin.yml up -d
|
||||||
|
|
||||||
|
Production:
|
||||||
|
sudo docker compose --env-file .env.prod -f pgadmin.yml up -d
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
Nginx run:
|
||||||
|
|
||||||
|
Development:
|
||||||
|
sudo docker compose --env-file .env.dev -f nginx.yml up -d
|
||||||
|
|
||||||
|
Production:
|
||||||
|
sudo docker compose --env-file .env.prod -f nginx.yml up -d
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
@ -1,25 +0,0 @@
|
|||||||
PORT=5000
|
|
||||||
POSTGRES_HOST=postgres
|
|
||||||
POSTGRES_USER=checkers
|
|
||||||
POSTGRES_DB=checkers
|
|
||||||
POSTGRESS_PASSWORD=477iyetc44i2th6za8r7
|
|
||||||
POSTGRES_PASSWORD=477iyetc44i2th6za8r7
|
|
||||||
POSTGRESS_PORT=5432
|
|
||||||
POSTGRES_PORT=5432
|
|
||||||
PRIVATE_KEY=secret_key_safasf
|
|
||||||
JWT_ACCESS_SECRET=7xTJ7WmRGZHGZGRih9w6pLSLvcbz2jpM
|
|
||||||
JWT_REFRESH_SECRET=ikuwEkxy2xctmSpQLpfw4vdGs6bk9dq3
|
|
||||||
SMTP_HOST="smtp.beget.com"
|
|
||||||
SMTP_PORT=465
|
|
||||||
X_SMTP_USER=checkers@rozenlab.com
|
|
||||||
SMTP_USER=messenger@rozenlab.com
|
|
||||||
X_SMTP_PASSWORD=X$sory79bak3yen3jzba
|
|
||||||
SMTP_PASSWORD=M$sory79bak3yen3jzba
|
|
||||||
API_URL=https://chback.rozenlab.com:7878
|
|
||||||
XCLIENT_URL=https://192.168.1.2:9500
|
|
||||||
CLIENT_URL=https://localhost
|
|
||||||
ACCESS_TOKEN_MAX_AGE=70d
|
|
||||||
REFRESH_TOKEN_MAX_AGE=70d
|
|
||||||
COOKIE_REFRESH_TOKEN_MAX_AGE=6048000000
|
|
||||||
XHTTPS_ENABLE=false
|
|
||||||
HTTPS_ENABLE=true
|
|
||||||
29
start.sh
Normal file
29
start.sh
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Please provide the environment type as an argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ENV_TYPE="$1" # dev / prod
|
||||||
|
|
||||||
|
echo "Start server on environment $ENV_TYPE..."
|
||||||
|
|
||||||
|
#Traefik run:
|
||||||
|
sudo docker compose --env-file .env.$ENV_TYPE -f traefik.yml up -d
|
||||||
|
|
||||||
|
#Gitea run:
|
||||||
|
sudo docker compose --env-file .env.$ENV_TYPE -f gitea.yml up -d
|
||||||
|
|
||||||
|
#Postgres run:
|
||||||
|
sudo docker compose -f postgres.yml up -d
|
||||||
|
|
||||||
|
#Pgadmin run:
|
||||||
|
sudo docker compose --env-file .env.$ENV_TYPE -f pgadmin.yml up -d
|
||||||
|
|
||||||
|
#Nginx run:
|
||||||
|
sudo docker compose --env-file .env.$ENV_TYPE -f nginx.yml up -d
|
||||||
|
|
||||||
|
echo "All successfully started to environment $ENV_TYPE."
|
||||||
15
traefik.yml
15
traefik.yml
@ -8,10 +8,6 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- ./secrets/vars.env
|
- ./secrets/vars.env
|
||||||
command:
|
command:
|
||||||
#tls:
|
|
||||||
#certificates:
|
|
||||||
#- certFile: /secrets/selfsigned/selfsigned.crt
|
|
||||||
#keyFile: /secrets/selfsigned/selfsigned.key
|
|
||||||
- "--providers.file.filename=/traefik/certs.yml"
|
- "--providers.file.filename=/traefik/certs.yml"
|
||||||
- "--api.insecure=false"
|
- "--api.insecure=false"
|
||||||
- "--api.dashboard=true"
|
- "--api.dashboard=true"
|
||||||
@ -56,6 +52,17 @@ services:
|
|||||||
options:
|
options:
|
||||||
max-size: "1m"
|
max-size: "1m"
|
||||||
|
|
||||||
|
initContainers:
|
||||||
|
container_name: volume-permissions
|
||||||
|
image: busybox:1.36.1-glibc
|
||||||
|
|
||||||
|
command: >
|
||||||
|
sh -c "touch /letsencrypt/acme.json &&
|
||||||
|
chmod -Rv 600 /letsencrypt/* &&
|
||||||
|
chown 65532:65532 /letsencrypt/acme.json &&
|
||||||
|
volumes:
|
||||||
|
- ./secrets/letsencrypt:/letsencrypt
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxynet:
|
proxynet:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|||||||
@ -1,10 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Docker Nginx</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h2>DEMO</h2>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
Reference in New Issue
Block a user