Skip to content

Commit

Permalink
Add osmcha-frontend container
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Jan 30, 2025
1 parent 1623855 commit 515a4ef
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chartpress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ charts:
valuesPath: ohm.tilerCache.image
cgimap:
valuesPath: ohm.cgimap.image
osmcha-frontend:
valuesPath: ohm.osmchaWeb.image
28 changes: 28 additions & 0 deletions images/osmcha-frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:22-alpine as builder

ENV DEBIAN_FRONTEND noninteractive

ARG GITSHA=e5d7de531016c3e4cb9aef684c2e8c3bff20e602
ARG BUILD_ENV=prod

WORKDIR /app

## Clone osmcha repo
RUN apk add --no-cache git \
&& git clone https://github.com/OpenHistoricalMap/osmcha-frontend.git/app \
&& cd /app \
&& git checkout $GITSHA

RUN yarn set version stable
RUN yarn install

ENV REACT_APP_PRODUCTION_API_URL /api/v1
ENV NODE_OPTIONS --openssl-legacy-provider

RUN yarn run build:${BUILD_ENV}

FROM nginx:alpine

COPY --from=builder /app/build /srv/www

COPY nginx.conf /etc/nginx/templates/default.conf.template
36 changes: 36 additions & 0 deletions images/osmcha-frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
server {
listen 80;
charset utf-8;

include /etc/nginx/mime.types;
default_type application/octet-stream;

gzip on;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;

location ~ ^/(api|admin) {
# /api and /admin routes are handled by the backend
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass $BACKEND_URL;
}

location /static {
# /static files are served without any magic (exact path or 404)
root /srv/www;
try_files $uri =404;
}

location / {
# other routes are served by trying the exact path, and falling back to
# serving the app entrypoint (index.html). this is needed because the
# frontend JS code uses the path component of the URL in its client-side
# routing.
root /srv/www;
try_files $uri $uri/ /index.html;
}
}
4 changes: 4 additions & 0 deletions ohm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ osm-seed:
image:
name: chartpress_replace_me
tag: chartpress_replace_me
osmchaWeb:
image:
name: chartpress_replace_me
tag: chartpress_replace_me
ohm:
tilerCache:
image:
Expand Down

0 comments on commit 515a4ef

Please sign in to comment.