diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index d0ef90cd..185e5131 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -140,6 +140,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + build-args: config=nginx.conf build-redis: runs-on: ubuntu-latest diff --git a/cyan_flask/requirements.txt b/cyan_flask/requirements.txt index 64d2a8fb..0a603ac0 100644 --- a/cyan_flask/requirements.txt +++ b/cyan_flask/requirements.txt @@ -1,15 +1,15 @@ -bcrypt==3.2.0 -celery==5.2.2 -cryptography==36.0.2 -Flask==2.0.3 -Flask-Cors==3.0.10 -Flask-Migrate==3.1.0 -Flask-RESTful==0.3.9 -Flask-SQLAlchemy==2.5.1 -mysqlclient==2.1.0 -mysql-connector-python==8.0.28 -PyJWT==2.3.0 -python-dotenv==0.19.2 -redis==4.1.4 +bcrypt==4.0.1 +celery==5.3.1 +cryptography==41.0.2 +Flask==2.3.2 +Flask-Cors==4.0.0 +Flask-Migrate==4.0.4 +Flask-RESTful==0.3.10 +Flask-SQLAlchemy==3.0.5 +mysqlclient==2.2.0 +mysql-connector-python==8.0.33 +PyJWT==2.7.0 +python-dotenv==1.0.0 +redis==4.6.0 requests==2.25.1 -simplejson==3.17.6 \ No newline at end of file +simplejson==3.19.1 \ No newline at end of file diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile index 215996e9..0c2370e6 100644 --- a/docker/nginx/Dockerfile +++ b/docker/nginx/Dockerfile @@ -14,7 +14,7 @@ ARG config=nginx.conf RUN rm -rf /usr/share/nginx/html/* && \ rm /etc/nginx/conf.d/default.conf -COPY ./docker/nginx/nginx.conf /etc/nginx/conf.d +COPY ./docker/nginx/$config /etc/nginx/conf.d # Uses "node-builder" image from docker/angular/Dockerfile # COPY --from=node-builder /app/dist /usr/share/nginx/html diff --git a/docker/nginx/nginx-dev.conf b/docker/nginx/nginx-dev.conf new file mode 100644 index 00000000..646522c2 --- /dev/null +++ b/docker/nginx/nginx-dev.conf @@ -0,0 +1,39 @@ +upstream cyanweb_flask { + server cyanweb-flask:5001; +} + +server { + + listen 80; + + # Cyanweb Flask API + location /cyanweb/cyan/app/api { + rewrite /cyanweb/(.*)$ /$1 break; + include /etc/nginx/uwsgi_params; + uwsgi_pass cyanweb_flask; + } + + # Cyano Backend API + location /cyanweb/cyan/cyano { + proxy_pass https://ceamdev.ceeopdev.net/cyan/cyano; + } + + # Cyan-waterbody Backend API + location /cyanweb/waterbody { + proxy_pass https://ceamdev.ceeopdev.net/waterbody; + } + + # Cyanweb - prevents env.json caching: + location /cyanweb/assets/env.json { + expires -1; + add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; + alias /usr/share/nginx/html/cyanweb/assets/env.json; + } + + # Cyanweb Frontend + location /cyanweb { + alias /usr/share/nginx/html/cyanweb; + try_files $uri $uri/ /cyanweb/index.html; + } + +} \ No newline at end of file