Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Docker Image CD

on:
push:
branches: [ master, next ]

jobs:
docker-build-squash-push:
Expand All @@ -11,26 +10,3 @@ jobs:
tag: ${{ github.ref_name }}
secrets:
TOKEN: ${{secrets.GITHUB_TOKEN}}

amazon-ecr:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/next' || github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.TOKEN }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/m4f6w3w9
docker build -t opengeodeweb-router .
docker tag opengeodeweb-router:latest public.ecr.aws/m4f6w3w9/opengeodeweb-router:${{github.ref_name}}
docker push public.ecr.aws/m4f6w3w9/opengeodeweb-router:${{github.ref_name}}

7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf

RUN \
apk add openssl && \
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.crt -subj "/C=FR/ST=France/L=Pau/O=Geode-solutions"


EXPOSE 443
EXPOSE 80
22 changes: 14 additions & 8 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ events {
worker_connections 1024;
}

map $http_origin $allow_origin {
~^https://(.*\.)?geode-solutions\.com$ $http_origin;
default "";
}

http {
# Nginx will handle gzip compression of responses from the app server
gzip on;
Expand All @@ -10,19 +15,20 @@ http {
gzip_min_length 1000;

server {
listen 443 ssl;
listen 80;
server_name localhost;

ssl_certificate nginx.crt;
ssl_certificate_key nginx.key;

client_max_body_size 0;

add_header Access-Control-Allow-Origin $allow_origin;
add_header Access-Control-Allow-Credentials true;
add_header Vary Origin;

location ~ "^/[a-z0-9]{32}/geode/" {
location ~ "^/geode/" {
if ($request_method !~ ^(DELETE|GET|POST|PUT|OPTIONS)$) {
return 405;
}
rewrite "^/[a-z0-9]{32}/geode/(.*)" /$1 break;
rewrite "^/geode/(.*)" /$1 break;
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Host $host;
Expand All @@ -31,11 +37,11 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}

location ~ "^/[a-z0-9]{32}/viewer/" {
location ~ "^/viewer/" {
if ($request_method !~ ^(GET|POST|OPTIONS)$) {
return 405;
}
rewrite "^/[a-z0-9]{32}/viewer/(.*)" /$1 break;
rewrite "^/viewer/(.*)" /$1 break;
proxy_pass http://localhost:1234;
proxy_http_version 1.1;
proxy_set_header Host $host;
Expand Down
Loading