Skip to content

Updates to devops/deploy based on to-docker prod upgrades and archiving of unused files #1093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target
bin
out
.idea*
.sdkmanrc
*.ipr
*.iml
*.iws
Expand Down Expand Up @@ -43,6 +44,5 @@ catalina.base_IS_UNDEFINED
/frontend/dist
/frontend/.env
/frontend/build
/frontend/.env
/frontend/src/serviceWorkerRegistration.js
/frontend/src/serviceWorker.js
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
129 changes: 0 additions & 129 deletions devops/deploy/.dockerfiles/db/initdb.d/zz_init_tables.sql

This file was deleted.

17 changes: 17 additions & 0 deletions devops/deploy/.dockerfiles/db/postgresql.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
listen_addresses = '*'
max_connections = 300

shared_buffers = 8GB
work_mem = 40MB

# WAL
max_wal_size = 8GB
wal_writer_flush_after = 1MB

# Checkpoints
checkpoint_timeout = 10min
checkpoint_completion_target = 0.8

# Background Writer
bgwriter_lru_maxpages = 1000
bgwriter_lru_multiplier = 3.0
24 changes: 24 additions & 0 deletions devops/deploy/.dockerfiles/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
map $request_uri $loggable {
/ 0;
default 1;
}

server {
listen 80;
server_name 0.0.0.0;
client_max_body_size 2g;

access_log /var/log/nginx/access.log combined if=$loggable;

proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
Expand All @@ -14,4 +20,22 @@ server {
}
}

server {
listen 443 ssl;
server_name xxx.wildbook.org;
client_max_body_size 2g;

ssl_certificate /etc/letsencrypt/live/xxx.wildbook.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/xxx.wildbook.org/privkey.pem;

access_log /var/log/nginx/access.log combined if=$loggable;

proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
location / {
proxy_read_timeout 1200;
proxy_connect_timeout 1200;
proxy_send_timeout 1200;
proxy_pass http://wildbook:8080/;
}
}
35 changes: 20 additions & 15 deletions devops/deploy/_env.template
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
# these settings are fine for a development server, but should be changed to different choices for production environments

# placeholder dev pwd and user settings should be changed for production environments

## for smtp (postfix) usage:
MAIL_HOSTNAME=example.org
MAIL_ALLOWED_SENDER_DOMAINS=example.org
MAIL_PORT=1587
MAIL_RELAYHOST=smtp.examplehost.com:587
MAIL_RELAYHOST_USERNAME=dev
MAIL_RELAYHOST_PASSWORD=development

## for opensearch
# password should be strong:
# it should be at least 8 characters and must contain at least one uppercase letter,
# one lowercase letter, one digit, and one special character.
OPENSEARCH_INITIAL_ADMIN_PASSWORD=development

## for db:
POSTGRES_PASSWORD=development

PGADMIN_DEFAULT_EMAIL=dev@example.com
PGADMIN_DEFAULT_EMAIL=dev@example.org
PGADMIN_DEFAULT_PASSWORD=development

# FIXME this will become irrelevant when war file is included in docker image
# this should be a directory on your host system where you want to put your files related to development
# you *must* create:
# - $WILDBOOK_BASE_DIR/webapps/ (this is where you will deploy your war file to, under a subdir wildbook/)
# - $WILDBOOK_BASE_DIR/logs/ (logs will go here)
WILDBOOK_BASE_DIR=/tmp

WILDBOOK_DB_NAME=wildbook
WILDBOOK_DB_USER=wildbook
WILDBOOK_DB_PASSWORD=development

#: i.e. jdbc:postgresql://db:5432/${WILDBOOK_DB_NAME}
WILDBOOK_DB_CONNECTION_URL=jdbc:postgresql://db:5432/wildbook


# for wbia:
WBIA_DB_NAME=wbia
WBIA_DB_USER=wbia
WBIA_DB_PASSWORD=development
Expand All @@ -27,7 +36,3 @@ WBIA_DB_PASSWORD=development
WBIA_DB_URI=postgresql://wbia:development@db/wbia
#: Location within the container
WBIA_DB_DIR=/data/db


#SERVER_URL=http://wildbook.example.com
SERVER_URL=http://localhost:81
9 changes: 9 additions & 0 deletions devops/deploy/cron/daily/backup_postgresql_sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

target=/data/backups/postgresql/lynx-live-db-`date +%Y-%m-%d`.sql

cd /data/wb-docker-deploy

docker compose exec -T db pg_dump -O --exclude-table-data='"IDENTITYSERVICELOG"' wildbook > $target

gzip $target
Loading