Skip to content

Commit

Permalink
Build osmcha to ohm config + add env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel committed Oct 12, 2023
1 parent b46f555 commit e804bd6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
11 changes: 8 additions & 3 deletions envs/.env.osmcha.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ OAUTH_OSM_SECRET=xya
DJANGO_ANON_USER_THROTTLE_RATE=30/min
DJANGO_COMMON_USER_THROTTLE_RATE=180/min
DJANGO_NON_STAFF_USER_THROTTLE_RATE=3/min
OAUTH_REDIRECT_URI=http://localhost:8000/oauth-landing.html
OSMCHA_FRONTEND_VERSION=oh-pages
OSMCHA_URL=public-url
OAUTH_REDIRECT_URI=$OSMCHA_URL/oauth-landing.html
DJANGO_ENABLE_CHANGESET_COMMENTS=False
DJANGO_OSM_COMMENTS_API_KEY=""
DJANGO_ROOT=/app
DJANGO_SETTINGS_MODULE=config.settings.local
C_FORCE_ROOT=True
OSMCHA_FRONTEND_VERSION=v0.86.0-production
REACT_APP_OSM_URL=https://www.openhistoricalmap.org
REACT_APP_OSM_API=https://www.openhistoricalmap.org/api/0.6
REACT_APP_OVERPASS_BASE=https://overpass-api.openhistoricalmap.org/api/interpreter
REACT_APP_NOMINATIM_URL=https://www.openhistoricalmap.org/geocoder/search_osm_nominatim
REACT_APP_PRODUCTION_API_URL=$OSMCHA_URL/api/v1
REACT_APP_MAPBOX_ACCESS_TOKEN=''
9 changes: 9 additions & 0 deletions images/osmcha-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ RUN pip3 install git+https://github.com/OpenHistoricalMap/social-core.git@master
RUN pip3 install -U requests
RUN pip3 install certifi
RUN pip3 install django-extensions
# Clone and build the frontend
RUN git clone [email protected]:mapbox/osmcha-frontend.git
WORKDIR /app/osmcha-frontend
RUN yarn
RUN REACT_APP_VERSION=ohm REACT_APP_STACK=PRODUCTION PUBLIC_URL=$OSMCHA_URL npx react-scripts build
RUN cp -R ./build/*.html ../osmchadjango/frontend/templates/frontend/
RUN cp ./build/* ../osmchadjango/static/
RUN cp -R ./build/static/* ../osmcha-django/osmchadjango/static

ADD . /app

RUN echo "alias python=python3" >> ~/.bashrc
Expand Down
1 change: 0 additions & 1 deletion images/osmcha-web/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash
set -e
python3 manage.py update_frontend
python3 manage.py collectstatic --noinput
python3 manage.py migrate
python3 manage.py runserver 0.0.0.0:8000

0 comments on commit e804bd6

Please sign in to comment.