Skip to content
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

Planet server files #314

Merged
merged 4 commits into from
Feb 21, 2024
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
4 changes: 3 additions & 1 deletion chartpress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ charts:
valuesPath: osmchaWeb.image
osmcha-db:
valuesPath: osmchaDb.image

planet-files:
valuesPath: planetFiles.image

6 changes: 1 addition & 5 deletions compose/db-backup-restore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ services:
dockerfile: Dockerfile
volumes:
- ../data/db-backup-restore-data:/mnt/data
command: >
/bin/bash -c "
echo 'Set cron job for backing up DB, every 4 minutes';
while :; do echo 'Creating DB backup...'; /start.sh; sleep 4m; done;
"
command: /start.sh
env_file:
- ../envs/.env.db
- ../envs/.env.osmcha
Expand Down
22 changes: 0 additions & 22 deletions compose/full-history.yml

This file was deleted.

30 changes: 0 additions & 30 deletions compose/planet-dump.yml

This file was deleted.

89 changes: 89 additions & 0 deletions compose/planet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
version: '3'
services:
######################################################
### OSM minute replication files section
######################################################
replication-job:
image: osmseed-replication-job:v1
build:
context: ../images/replication-job
dockerfile: Dockerfile
volumes:
- ../data/replication-job-data:/mnt/data
# - ./../images/replication-job:/app
command: /start.sh
env_file:
- ../envs/.env.db
- ../envs/.env.db-utils
- ../envs/.env.cloudprovider

######################################################
### Planet replication section
######################################################
planet-dump:
image: osmseed-planet-dump:v1
build:
context: ../images/planet-dump
dockerfile: Dockerfile
volumes:
- ../data/planet-dump-data:/mnt/data
command: /start.sh;
env_file:
- ../envs/.env.db
- ../envs/.env.db-utils
- ../envs/.env.cloudprovider

#####################################################
## OSM full planet replication
#####################################################
full-history:
image: osmseed-full-history:v1
build:
context: ../images/full-history
dockerfile: Dockerfile
volumes:
- ../data/full-history-data:/mnt/data
command: /start.sh
env_file:
- ../envs/.env.db
- ../envs/.env.db-utils
- ../envs/.env.cloudprovider

#####################################################
## Changeset replications
#####################################################
changeset-replication-job:
image: osmseed-changeset-replication-job:v1
build:
context: ../images/changeset-replication-job
dockerfile: Dockerfile
volumes:
- ../data/changeset-replication-job-data:/mnt/changesets
command: >
/bin/bash -c "./start.sh"
env_file:
- ../envs/.env.db
- ../envs/.env.db-utils
- ../envs/.env.cloudprovider

######################################################
### NGINX container for serving files
######################################################
planet-files:
image: osmseed-planet-files:v1
build:
context: ../images/planet-files
dockerfile: Dockerfile
ports:
- "8081:80"
- "3000:3000"
volumes:
# Serve minute replication files
- ../data/replication-job-data:/usr/share/nginx/html/server/static-files/replication/minute
# Serve planet dump files
- ../data/planet-dump-data:/usr/share/nginx/html/server/static-files/planet
# Serve full history planet file
- '.../data/full-history-data:/usr/share/nginx/html/server/static-files/full-planet'
- '../data/changeset-replication-job-data:/usr/share/nginx/html/server/static-files/changesets'
# Development mode
# - ./../images/planet-files/:/usr/share/nginx/html/
32 changes: 0 additions & 32 deletions compose/replication.yml

This file was deleted.

16 changes: 8 additions & 8 deletions compose/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ services:
context: ../images/db
dockerfile: Dockerfile
ports:
- '5432:5432'
volumes:
- ../data/db-data:/var/lib/postgresql/data
- '5432:5432'
# volumes:
# - ../data/db-data:/var/lib/postgresql/data
env_file:
- ../envs/.env.db
- ../envs/.env.db
web:
image: osmseed-web:v1
build:
context: ../images/web
dockerfile: Dockerfile
ports:
- '80:80'
- '80:80'
env_file:
- ../envs/.env.web
- ../envs/.env.db
- ../envs/.env.web
- ../envs/.env.db
depends_on:
- db
- db
16 changes: 3 additions & 13 deletions images/full-history/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,8 @@ In order to run this container we need environment variables, these can be found

**Note**: Rename the above files as `.env.db`, `.env.db-utils` and `.env.cloudprovider`

#### Running full-history container

### Build and bring up the container
```sh
# Docker compose
docker-compose run full-history

# Docker
docker run \
--env-file ./envs/.env.db \
--env-file ./envs/.env.full-history \
--env-file ./envs/.env.cloudprovider \
-v ${PWD}/data/full-history-data:/mnt/data \
--network osm-seed_default \
-it osmseed-full-history:v1
docker compose -f ./compose/planet.yml build
docker compose -f ./compose/planet.yml up full-history
```
16 changes: 3 additions & 13 deletions images/planet-dump/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,8 @@ In order to run this container we need environment variables, these can be found

**Note**: Rename the above files as `.env.db`, `.env.db-utils` and `.env.cloudprovider`

#### Running planet-dump container

### Build and bring up the container
```sh
# Docker compose
docker-compose run planet-dump

# Docker
docker run \
--env-file ./envs/.env.db \
--env-file ./envs/.env.planet-dump \
--env-file ./envs/.env.cloudprovider \
-v ${PWD}/data/planet-dump-data:/mnt/data \
--network osm-seed_default \
-it osmseed-planet-dump:v1
docker compose -f ./compose/planet.yml build
docker compose -f ./compose/planet.yml up planet-dump
```
10 changes: 10 additions & 0 deletions images/planet-files/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM nginx:latest
RUN apt-get update && \
apt-get install -y nodejs npm && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/share/nginx/html/server/
COPY server/package.json ./
RUN npm install
COPY server/server.js ./
COPY index.html /usr/share/nginx/html/
CMD ["sh", "-c", "nginx -g 'daemon off;' & node server.js"]
11 changes: 11 additions & 0 deletions images/planet-files/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Planet server files

This container is based on Nginx and serves data related to planet, replication, and changesets for easy access and download, similar to how it is done in OpenStreetMap.


# Build and bring up the container
```sh
docker compose -f ./compose/planet.yml build
docker compose -f ./compose/planet.yml up planet-files
```
Loading
Loading