From 09ec6706577fc5663ba73de4a01a94aa3ef5c81e Mon Sep 17 00:00:00 2001 From: Rub21 Date: Fri, 23 Feb 2024 20:53:19 +0000 Subject: [PATCH] Update compose config --- compose/nominatim.yml | 3 ++- compose/planet.yml | 8 ++++++++ compose/web.yml | 2 +- images/tasking-manager-web/Dockerfile | 19 +++++++++++++++++++ images/tasking-manager-web/README.md | 13 +++++++++++++ 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 images/tasking-manager-web/Dockerfile create mode 100644 images/tasking-manager-web/README.md diff --git a/compose/nominatim.yml b/compose/nominatim.yml index cb0a1c07..ff3349d2 100644 --- a/compose/nominatim.yml +++ b/compose/nominatim.yml @@ -10,9 +10,10 @@ services: dockerfile: Dockerfile ports: - '8080:8080' - - '5432:5432' + # - '5432:5432' volumes: - ../data/nominatim-data:/var/lib/postgresql/14/main # - ../../Nominatim/nominatim/tokenizer/sanitizers:/usr/local/lib/nominatim/lib-python/nominatim/tokenizer/sanitizers env_file: - ../envs/.env.nominatim + restart: always diff --git a/compose/planet.yml b/compose/planet.yml index 720fde58..c16f9990 100644 --- a/compose/planet.yml +++ b/compose/planet.yml @@ -16,6 +16,7 @@ services: - ../envs/.env.db - ../envs/.env.db-utils - ../envs/.env.cloudprovider + restart: always ###################################################### ### Planet replication section @@ -32,6 +33,7 @@ services: - ../envs/.env.db - ../envs/.env.db-utils - ../envs/.env.cloudprovider + restart: always ##################################################### ## OSM full planet replication @@ -48,6 +50,7 @@ services: - ../envs/.env.db - ../envs/.env.db-utils - ../envs/.env.cloudprovider + restart: always ##################################################### ## Changeset replications @@ -65,6 +68,7 @@ services: - ../envs/.env.db - ../envs/.env.db-utils - ../envs/.env.cloudprovider + restart: always ###################################################### ### NGINX container for serving files @@ -87,3 +91,7 @@ services: - '../data/changeset-replication-job-data:/usr/share/nginx/html/server/static-files/changesets' # Development mode # - ./../images/planet-files/:/usr/share/nginx/html/ + restart: always +networks: + osm-seed: + driver: bridge \ No newline at end of file diff --git a/compose/web.yml b/compose/web.yml index 4029f004..66a54086 100644 --- a/compose/web.yml +++ b/compose/web.yml @@ -33,4 +33,4 @@ services: image: memcached:latest ports: - '11211:11211' - restart: always \ No newline at end of file + restart: always diff --git a/images/tasking-manager-web/Dockerfile b/images/tasking-manager-web/Dockerfile new file mode 100644 index 00000000..ba973fe5 --- /dev/null +++ b/images/tasking-manager-web/Dockerfile @@ -0,0 +1,19 @@ + +FROM node:12 AS builder +RUN sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list +RUN sed -i 's|security.debian.org|archive.debian.org|g' /etc/apt/sources.list +RUN sed -i '/stretch-updates/d' /etc/apt/sources.list +RUN apt-get update && apt-get -y install apt-transport-https +RUN apt-get update && \ + apt-get install -y git +WORKDIR /app +ENV GITSHA=951039f86938b9cc9d8b6986c4e5f3423a78e4d3 +RUN git clone https://github.com/hotosm/tasking-manager.git /app +WORKDIR /app/frontend +RUN git checkout $GITSHA +RUN npm install && npm run build + +FROM nginx:latest +COPY --from=builder /app/frontend/build /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/images/tasking-manager-web/README.md b/images/tasking-manager-web/README.md new file mode 100644 index 00000000..78634754 --- /dev/null +++ b/images/tasking-manager-web/README.md @@ -0,0 +1,13 @@ +# Docker setup for Tasking Manager 4 API + +### Configuration +1. Copy `./envs/.env.tasking-manager.example` to `./envs/.env.tasking-manager` +2. This setup doesn't come with a database container, so you'd have to standup your own. For now. +3. Supply appropirate environment variables, particularly OAuth keys and database credentials + + +### Build and run +* `cd tasking-manager-api` +* `docker build -t osmseed-tasking-manager-api:v1 .` +* `docker run --env-file ../.env-tasking-manager -p "5000:5000" -t osmseed-tasking-manager-api:v1` +