-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSMCha containers and helm templates (#305)
* docker images for osmcha * Add root user to install missing modules Update values.yaml * Refactoring osmcha Update osmcha-deployments Remove osmcha-api in chartpress * Update Ruby version Set ubuntu 20.04 Add missing libs Add libv8-dev Update ruby version Fix web continaer * Update ruby for taginfo Add port names for osmcha * Update osmcha deployment Update osmcha deployment Update services * Update osmcha values * Update osmcha wbe contianer and helm templates * Update osmcha template * Update config * Update osmcha config * Update osmcha service * Update values * Update overpass start script * Update entrypoint overpass * Update cmd for overpass * Update overpas container * Fix cli for overpass * Update overpass api * Update helm template for overpass * Enable livenessProbe for overpass
- Loading branch information
Showing
21 changed files
with
743 additions
and
627 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,4 @@ charts: | |
valuesPath: osmchaWeb.image | ||
osmcha-db: | ||
valuesPath: osmchaDb.image | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,60 @@ | ||
version: '3' | ||
version: "3.8" | ||
services: | ||
osmcha-db: | ||
web: | ||
platform: linux/amd64 | ||
image: developmentseed/osmseed-osmcha-web:v16 | ||
build: | ||
context: ../images/osmcha-web | ||
dockerfile: Dockerfile | ||
env_file: | ||
- ../envs/.env.osmcha | ||
volumes: | ||
- ../data/osmcha/staticfiles:/staticfiles | ||
db: | ||
platform: linux/amd64 | ||
image: osmseed-osmcha-db:v1 | ||
build: | ||
context: ../images/osmcha-db | ||
dockerfile: Dockerfile | ||
ports: | ||
- '5432:5432' | ||
- "5432:5432" | ||
volumes: | ||
- ../data/osmcha-db-data:/var/lib/postgresql/data | ||
env_file: | ||
- ../envs/.env.osmcha | ||
osmcha-web: | ||
init: | ||
platform: linux/amd64 | ||
image: osmseed-osmcha-web:v1 | ||
image: ghcr.io/willemarcel/osmcha-django:b1f4e6afc90e08707cadc4d74580632ca3b93dd2 | ||
command: > | ||
/bin/bash -c " | ||
set -x | ||
python manage.py collectstatic | ||
python manage.py migrate | ||
mkdir -p /staticfiles/static | ||
cp -r /app/staticfiles/* /staticfiles/static/ | ||
" | ||
env_file: | ||
- ../envs/.env.osmcha | ||
volumes: | ||
- ../data/osmcha/staticfiles:/staticfiles | ||
api: | ||
platform: linux/amd64 | ||
image: ghcr.io/willemarcel/osmcha-django:b1f4e6afc90e08707cadc4d74580632ca3b93dd2 | ||
build: | ||
context: ../images/osmcha-web | ||
context: ../images/osmcha-api | ||
dockerfile: Dockerfile | ||
command: > | ||
/bin/bash -c " | ||
set -x | ||
python manage.py collectstatic | ||
python manage.py migrate | ||
mkdir -p /staticfiles/static | ||
cp -r /app/staticfiles/* /staticfiles/static/ | ||
gunicorn --workers 4 --bind 0.0.0.0:5000 --log-file - --access-logfile - config.wsgi | ||
" | ||
ports: | ||
- '8000:8000' | ||
- "5000:5000" | ||
env_file: | ||
- ../envs/.env.osmcha | ||
volumes: | ||
- ../data/osmcha/staticfiles:/staticfiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,11 @@ | ||
FROM ubuntu:20.04 | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update -y -qq | ||
RUN apt-get install -y curl python3 python3-dev \ | ||
python3-pip git libgeos-dev libyaml-dev \ | ||
libcurl4-gnutls-dev librtmp-dev python3-gdal \ | ||
locales nginx supervisor yarnpkg nodejs npm | ||
RUN locale-gen en_US.UTF-8 | ||
RUN apt-get clean | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
# Install yarn. | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
RUN apt-get update -y | ||
RUN apt-get remove -y yarnpkg cmdtest && apt-get install -y yarn && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Setup nginx | ||
RUN rm /etc/nginx/sites-enabled/default | ||
COPY django.conf /etc/nginx/sites-available/ | ||
RUN ln -s /etc/nginx/sites-available/django.conf /etc/nginx/sites-enabled/django.conf | ||
RUN echo "daemon off;" >> /etc/nginx/nginx.conf | ||
|
||
|
||
# Setting locale is required by unicode-slugify (osmcha-django python requirement) | ||
RUN locale-gen en_US.UTF-8 | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
|
||
FROM node:16-slim as builder | ||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV BUILD_ENV=prod | ||
ENV REACT_APP_PRODUCTION_API_URL=/api/v1 | ||
RUN apt-get update && apt-get install -y git | ||
RUN mkdir /app | ||
WORKDIR /app | ||
ENV BACKEND_VERSION v4.19.0 | ||
RUN git clone https://github.com/willemarcel/osmcha-django . | ||
RUN git checkout $BACKEND_VERSION | ||
RUN git pull origin $BACKEND_VERSION | ||
RUN pip3 install -r requirements/production.txt | ||
RUN pip3 install -r requirements/local.txt | ||
|
||
ADD . /app | ||
ENV DJANGO_ROOT /app | ||
ENV DJANGO_SETTINGS_MODULE config.settings.aws_production | ||
|
||
# Replace social-auth-core by a modified version that provides OHM authentication | ||
RUN pip3 install git+https://github.com/OpenHistoricalMap/social-core.git@master | ||
|
||
# Upgrading requests to the latest version. | ||
RUN pip3 install -U requests | ||
RUN pip3 install certifi | ||
RUN pip3 install django-extensions | ||
|
||
# Clone and build the frontend | ||
RUN git clone https://github.com/mapbox/osmcha-frontend.git /osmcha-frontend | ||
RUN cd /osmcha-frontend && yarn install | ||
|
||
RUN echo "alias python=python3" >> ~/.bashrc | ||
RUN echo "alias pip=pip3" >> ~/.bashrc | ||
|
||
EXPOSE 80 | ||
|
||
# Supervisor config | ||
RUN mkdir -p /var/log/supervisor | ||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
COPY gunicorn.conf /etc/supervisor/conf.d/gunicorn.conf | ||
|
||
COPY ./start.sh . | ||
CMD ./start.sh | ||
RUN git clone https://github.com/osmus/osmcha-frontend.git /app | ||
RUN yarn install | ||
COPY start.sh . | ||
CMD [ "/app/start.sh" ] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
# Build frontend | ||
cd /osmcha-frontend | ||
REACT_APP_VERSION=ohm REACT_APP_STACK=PRODUCTION PUBLIC_URL=$OSMCHA_URL npx react-scripts build | ||
cp -R build/*.html /app/osmchadjango/frontend/templates/frontend/ | ||
cp -R build/* /app/osmchadjango/static/ | ||
cp -R build/static/* /app/osmchadjango/static/ | ||
|
||
# Start service | ||
cd /app | ||
python3 manage.py collectstatic --noinput | ||
python3 manage.py migrate | ||
supervisord -c /etc/supervisor/supervisord.conf | ||
set -x | ||
export BUILD_ENV=prod | ||
export REACT_APP_PRODUCTION_API_URL=/api/v1 | ||
sed -i "s|https://osmcha.org|$OSMCHA_URL|g" package.json | ||
yarn build:${BUILD_ENV} | ||
find /app/build -type f -exec sed -i "s/www.openstreetmap.org/$OSMCHA_API_URL/g" {} + | ||
cp -r /app/build/* /assets/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM wiktorn/overpass-api:0.7.56.8 | ||
FROM wiktorn/overpass-api:latest | ||
COPY docker-entrypoint.sh /app/ | ||
RUN chmod a+rx /app/docker-entrypoint.sh | ||
CMD ["/app/docker-entrypoint.sh"] |
Oops, something went wrong.