Skip to content

Commit

Permalink
Build osmcha app
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Oct 16, 2023
1 parent 3df2f57 commit 1547f7e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 4 additions & 10 deletions images/osmcha-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,13 @@ 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 https://github.com/mapbox/osmcha-frontend.git /app/osmcha-frontend
WORKDIR /app/osmcha-frontend
RUN yarn install
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 -R build/* ../osmchadjango/static/
RUN cp -R build/static/* ../osmchadjango/static/

ADD . /app
# 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

COPY ./start.sh .
CMD ./start.sh
CMD ./start.sh
12 changes: 11 additions & 1 deletion images/osmcha-web/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/usr/bin/env bash
set -e
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
python3 manage.py runserver 0.0.0.0:8000

0 comments on commit 1547f7e

Please sign in to comment.