Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0b19f9a
Update README.md
PeterPetrik Apr 8, 2025
3ce7de7
Relocate CE deployment scripts. Introduce EE deployment scripts.
fernandinand Apr 9, 2025
9ef7289
Further refinements #420
fernandinand Apr 10, 2025
67adda9
Merge pull request #423 from MerginMaps/develop
MarcelGeo Apr 11, 2025
b12545f
add README for CE. Move current development.md file
fernandinand Apr 11, 2025
bb64136
Introduce common folder to standardize deployment across versions.
fernandinand Apr 11, 2025
4a2510e
bump version
MarcelGeo Apr 14, 2025
bd9091e
Merge pull request #428 from MerginMaps/bump_2025.3.0
MarcelGeo Apr 14, 2025
24469fd
Fix username generation with long int suffixes
varmar05 Apr 16, 2025
0cd7489
Merge pull request #430 from MerginMaps/fix_username_bigint_generation
MarcelGeo Apr 16, 2025
5278968
Merge pull request #429 from MerginMaps/dev-2025.3.1
MarcelGeo Apr 16, 2025
20893be
address gh review remarks
fernandinand Apr 17, 2025
8a83dd7
Merge branch 'master' into 420-rework-deployment
fernandinand Apr 17, 2025
9f7ac58
standardize container names to ease configurations
fernandinand Apr 22, 2025
6dc3b45
relocate development readme file
fernandinand Apr 22, 2025
67133a6
fix permissions script path and name
fernandinand Apr 22, 2025
c847293
still missing some more readme permissions fix
fernandinand Apr 22, 2025
36480b4
typo
fernandinand Apr 22, 2025
f91321d
fix .yml files extension
fernandinand Apr 22, 2025
7b2258a
fix container names
fernandinand Apr 22, 2025
a353bbd
Bump 2025.3.1
MarcelGeo Apr 23, 2025
fd27488
Final fixes for docker-compose and cleanup
MarcelGeo Apr 23, 2025
f8db855
Merge pull request #432 from MerginMaps/bump_2025.3.1
MarcelGeo Apr 23, 2025
4cb8274
cleanup version from env.template
MarcelGeo Apr 23, 2025
4613ac5
Do not user sudo docker when login with non sudo
harminius Apr 23, 2025
690be54
Cleanup web maps chapter
MarcelGeo Apr 23, 2025
e796d02
Merge branch 'master' into 420-rework-deployment
MarcelGeo Apr 23, 2025
c8eae0e
Merge pull request #421 from MerginMaps/420-rework-deployment
MarcelGeo Apr 23, 2025
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# demo data
projects/
projects*/
data/
mergin_db

logs
Expand All @@ -15,6 +16,8 @@ deps/
venv/
.vscode

# production env
.prod.env

# generated documentation
gen
Expand Down
2 changes: 1 addition & 1 deletion LICENSES/CLA-signed-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ C/ My company has custom contribution contract with Lutra Consulting Ltd. or I a
* lavor, 26th April 2023
* luxusko, 25th August 2023
* jozef-budac, 30th January 2024
* fernandinand, 13th March 2025
* fernandinand, 13th March 2025
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Admin users can enter the admin interface available at `/admin` URL which provid

### Contributing

Contributions are welcomed! You can set up development environment by following a guide in [development.md](./development.md). Before you create your first pull request, we kindly ask you to sign the CLA with your GitHub user name and date [here](LICENSES/CLA-signed-list.md).
Contributions are welcomed! You can set up development environment by following a guide in [development.md](./deployment/community/development.md). Before you create your first pull request, we kindly ask you to sign the CLA with your GitHub user name and date [here](LICENSES/CLA-signed-list.md).

## Documentation

Expand All @@ -86,14 +86,14 @@ If you'd like to contribute and improve the documentation, visit https://github.
If you need support, a custom deployment, extending the service capabilities and new features do not hesitate to contact us on info@lutraconsulting.co.uk
<br><br>

<div><a href="https://merginmaps.com/community/join"><img align="left" width="45" height="45" src="https://raw.githubusercontent.com/MerginMaps/docs/main/src/.vuepress/public/slack.svg">Join our community chat</a><br/>and ask questions!</div>
<div><img align="left" width="45" height="45" src="https://raw.githubusercontent.com/MerginMaps/docs/main/src/public/slack.svg"><a href="https://merginmaps.com/community/join">Join our community chat</a><br/>and ask questions!</div>
<br>

## Developers

Contributions are welcome!

More information for developers can be found in the dedicated [development](development.md) page.
More information for developers can be found in the dedicated [development](./deployment/community/development.md) page.

Client side modules:
- [Python](https://github.com/MerginMaps/python-api-client) client library + CLI
Expand Down
20 changes: 20 additions & 0 deletions deployment/common/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Copyright (C) Lutra Consulting Limited
#
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-MerginMaps-Commercial

# make sure all files created by gunicorn (mergin server) have proper permissions
umask 0027

# Settings passed to gunicorn have the following order of precedence
# (tested using --workers):
#
# 1. Command-line (highest)
# 2. Environment variable
# 3. File referenced by --config (lowest)
#
# We store a base config in config.py and override things as needed
# using the environment variable GUNICORN_CMD_ARGS.

exec sh -c "$@"
File renamed without changes.
14 changes: 14 additions & 0 deletions deployment/common/set_permissions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Changes permissions recursively at folder and files level from a provided path
# ARGS:
# 1 - The target path


set -e

export MERGIN_DIR=$1
sudo mkdir -p $MERGIN_DIR
sudo find $MERGIN_DIR -type f -exec sudo chmod 640 {} \;
sudo find $MERGIN_DIR -type d -exec sudo chmod 750 {} \;
sudo find $MERGIN_DIR -type d -exec sudo chmod g+s {} \;
sudo chown -R 901:999 $MERGIN_DIR
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions .prod.env → deployment/community/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ TEMP_DIR=/data/tmp

#DB_APPLICATION_NAME=mergin

#DB_DATABASE=postgres
#DB_DATABASE=mergin

#DB_HOST=localhost
DB_HOST=db

#DB_PASSWORD=postgres
DB_PASSWORD=postgres

#DB_POOL_MAX_OVERFLOW=10 # max_overflow set to SQLAlchemy default https://docs.sqlalchemy.org/en/14/core/engines.html

Expand Down
16 changes: 16 additions & 0 deletions deployment/community/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Mergin Maps Community Edition Deployment
Suitable for Ubuntu servers, one node deployment using docker compose and system nginx as a reverse proxy.

> [!IMPORTANT]
> You need to have Docker installed on your system.
> If you don't have, follow the official [documentation](https://docs.docker.com/engine/install/)

Then modify [docker-compose file](docker-compose.yml) and create environment file `.prod.env` from `.env.template`. Details about configuration can be find in [docs](https://merginmaps.com/docs/server/install/).

```shell
cp .env.template .prod.env
```

Next step is to create data directory for mergin maps `projects` with proper permissions. Should you prefer a different location, please do search and replace it in config files (`.prod.env`, `docker-compose.yml`). Make sure your volume is large enough since mergin maps keeps all projects files, their history and also needs some space for temporary processing.

For more details about deployment please check [docs](https://merginmaps.com/docs/server/install/#deployment).
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
version: "3.7"


services:
server-gunicorn:
image: server-gunicorn
server:
image: server
build:
context: ./server
context: ../../server
dockerfile: Dockerfile
env_file:
- .prod.env
- .dev.env
celery-beat:
image: celery-beat
build:
context: ./server
context: ../../server
dockerfile: Dockerfile
env_file:
- .prod.env
- .dev.env
celery-worker:
image: celery-worker
build:
context: ./server
context: ../../server
dockerfile: Dockerfile
env_file:
- .prod.env
- .dev.env
web:
image: merginmaps-frontend
build:
context: ./web-app
context: ../../web-app
dockerfile: Dockerfile
maildev:
image: maildev/maildev
Expand Down
25 changes: 13 additions & 12 deletions docker-compose.yml → deployment/community/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "3.7"

networks:
merginmaps:
name: mergin

services:
db:
Expand All @@ -10,8 +11,9 @@ services:
networks:
- merginmaps
environment:
- POSTGRES_DB=mergin
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_PASSWORD=postgres # !TODO Change this and also change .prod.env $DB_PASSWORD accordingly
volumes:
- ./mergin_db:/var/lib/postgresql/data
redis:
Expand All @@ -20,14 +22,14 @@ services:
restart: always
networks:
- merginmaps
server-gunicorn:
server:
image: lutraconsulting/merginmaps-backend:2025.2.2
container_name: merginmaps-server
restart: always
user: 901:999
volumes:
- ./projects:/data
- ./server/entrypoint.sh:/app/entrypoint.sh
- ../common/entrypoint.sh:/app/entrypoint.sh
env_file:
- .prod.env
depends_on:
Expand All @@ -46,10 +48,10 @@ services:
- GEVENT_WORKER=0
- NO_MONKEY_PATCH=1
volumes:
- ./server/entrypoint.sh:/app/entrypoint.sh
- ../common/entrypoint.sh:/app/entrypoint.sh
depends_on:
- redis
- server-gunicorn
- server
command: [ "celery -A application.celery beat --loglevel=info" ]
networks:
- merginmaps
Expand All @@ -65,10 +67,10 @@ services:
- NO_MONKEY_PATCH=1
volumes:
- ./projects:/data
- ./server/entrypoint.sh:/app/entrypoint.sh
- ../common/entrypoint.sh:/app/entrypoint.sh
depends_on:
- redis
- server-gunicorn
- server
- celery-beat
command: [ "celery -A application.celery worker --loglevel=info" ]
networks:
Expand All @@ -78,7 +80,7 @@ services:
container_name: merginmaps-web
restart: always
depends_on:
- server-gunicorn
- server
user: 101:999
links:
- db
Expand All @@ -93,8 +95,7 @@ services:
ports:
- "8080:8080"
volumes:
- ./projects:/data # map data dir to host
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- ./logs:/var/log/nginx/
- ./projects:/data # mergin maps projects data dir to host
- ../common/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- merginmaps
Loading
Loading