-
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.
* Add values for oauth2 - osmcha * Rename env var for oauth2 - osmcha * Fix env vars for osmcha * Update gitsha for osmcha * Update livenessProbe path * Add env var for Settings for PostgreSQL client * Update init container name * Update osmcha deployment to the new version * Osmcha web continaer * Add osmcha adiff config to deploy * Update config for osmcha adiff * Update redis name * Add env vars for osmcha adiff * Update env vars for osmcha-api * Update cronjob for osmcha fetch changesets * Ser cronjob value in quotes
- Loading branch information
Showing
9 changed files
with
231 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,39 @@ | ||
version: "3.8" | ||
services: | ||
web: | ||
platform: linux/amd64 | ||
image: developmentseed/osmseed-osmcha-web:v16 | ||
django: | ||
image: "ghcr.io/openhistoricalmap/osmcha-django:upstream_main" | ||
depends_on: | ||
- redis | ||
volumes: | ||
# Copy static files into a shared volume so the frontend can serve them | ||
- staticfiles:/app/staticfiles | ||
env_file: ./../envs/.env.osmcha | ||
ports: | ||
- "5001:5000" | ||
entrypoint: ["/bin/sh", "-c"] | ||
command: | ||
- | | ||
python manage.py migrate --verbosity 3 && \ | ||
python manage.py collectstatic --noinput && \ | ||
gunicorn config.wsgi -t 120 -b 0.0.0.0:5000 --access-logfile - --log-level debug | ||
frontend: | ||
build: | ||
context: ../images/osmcha-web | ||
dockerfile: Dockerfile | ||
env_file: | ||
- ../envs/.env.osmcha | ||
depends_on: | ||
- django | ||
volumes: | ||
- ../data/osmcha/staticfiles:/staticfiles | ||
db: | ||
platform: linux/amd64 | ||
image: osmseed-osmcha-db:v1 | ||
build: | ||
context: ../images/osmcha-db | ||
dockerfile: Dockerfile | ||
# frontend serves django app's static files via shared volume | ||
- staticfiles:/srv/www/static/django | ||
env_file: ./../envs/.env.osmcha | ||
|
||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- ../data/osmcha-db-data:/var/lib/postgresql/data | ||
env_file: | ||
- ../envs/.env.osmcha | ||
init: | ||
platform: linux/amd64 | ||
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-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 | ||
" | ||
- "8000:80" | ||
|
||
redis: | ||
image: redis:latest | ||
container_name: redis | ||
restart: always | ||
ports: | ||
- "5000:5000" | ||
env_file: | ||
- ../envs/.env.osmcha | ||
volumes: | ||
- ../data/osmcha/staticfiles:/staticfiles | ||
- "6379:6379" | ||
volumes: | ||
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,16 +1,28 @@ | ||
FROM node:16-slim as builder | ||
FROM node:22-alpine 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 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN mkdir /app | ||
|
||
ARG GITSHA=3cd987bd2ed02bbb60b121ecad0bb556a115aca1 | ||
ARG BUILD_ENV=prod | ||
|
||
WORKDIR /app | ||
ARG GITSHA=9925beeabcbc3b50eccc83dd92d71f2cf6791b04 | ||
RUN git clone --branch master https://github.com/osmus/osmcha-frontend.git /app | ||
RUN git checkout $GITSHA | ||
|
||
## Clone osmcha repo | ||
RUN apk add --no-cache git \ | ||
&& git clone https://github.com/OSMCha/osmcha-frontend.git /app \ | ||
&& cd /app \ | ||
&& git checkout $GITSHA | ||
|
||
RUN yarn set version stable | ||
RUN yarn install | ||
COPY start.sh . | ||
CMD [ "/app/start.sh" ] | ||
|
||
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 |
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 |
---|---|---|
@@ -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; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{- if .Values.adiffService.enabled -}} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Release.Name }}-osmcha-adiff-service-worker | ||
labels: | ||
app: {{ .Release.Name }}-osmcha-adiff-service-worker | ||
environment: {{ .Values.environment }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
replicas: {{ .Values.adiffService.replicas}} | ||
selector: | ||
matchLabels: | ||
app: {{ .Release.Name }}-osmcha-adiff-service-worker | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Release.Name }}-osmcha-adiff-service-worker | ||
spec: | ||
containers: | ||
- name: {{ .Release.Name }}-osmcha-adiff-service-worker | ||
image: "{{ .Values.adiffService.image.name }}:{{ .Values.adiffService.image.tag }}" | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /bin/sh | ||
- -c | ||
- yarn update-queue | ||
env: | ||
- name: ReplicationBucket | ||
value: {{ .Values.adiffService.env.ReplicationBucket }} | ||
- name: OsmchaAdminToken | ||
value: {{ .Values.adiffService.env.OsmchaAdminToken }} | ||
- name: OutputBucket | ||
value: {{ .Values.adiffService.env.OutputBucket }} | ||
- name: OverpassPrimaryUrl | ||
value: {{ .Values.adiffService.env.OverpassPrimaryUrl }} | ||
- name: OverpassSecondaryUrl | ||
value: {{ .Values.adiffService.env.OverpassSecondaryUrl }} | ||
### Redis Server comes from osmcha-api | ||
- name: RedisServer | ||
value: redis://localhost:6379 | ||
- name: NumberOfWorkers | ||
value: {{ .Values.adiffService.env.NumberOfWorkers | quote }} | ||
- name: NODE_OPTIONS | ||
value: {{ .Values.adiffService.env.NODE_OPTIONS }} | ||
- name: OsmchaUrl | ||
value: {{ .Values.adiffService.env.OsmchaUrl }} | ||
|
||
{{- if .Values.adiffService.nodeSelector.enabled }} | ||
nodeSelector: | ||
{{ .Values.adiffService.nodeSelector.label_key }}: {{ .Values.adiffService.nodeSelector.label_value }} | ||
{{- end }} | ||
{{- if .Values.adiffService.resources.enabled }} | ||
resources: | ||
requests: | ||
memory: {{ .Values.adiffService.resources.requests.memory }} | ||
cpu: {{ .Values.adiffService.resources.requests.cpu }} | ||
limits: | ||
memory: {{ .Values.adiffService.resources.limits.memory }} | ||
cpu: {{ .Values.adiffService.resources.limits.cpu }} | ||
{{- end }} | ||
- name: osmcha-redis-adiff | ||
image: "redis:latest" | ||
ports: | ||
- containerPort: 6379 | ||
{{- end }} |
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
Oops, something went wrong.