Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: remove nginx from docker compose #1733

Closed
wants to merge 8 commits into from
Closed
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
7 changes: 3 additions & 4 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ services:
depends_on:
- ibf-local-db
networks:
- web-server-network
- api-network
user: root

ibf-dashboard:
entrypoint: ['echo', 'Service ibf-dashboard disabled']

ibf-geoserver:
ports:
- 8081:8080
# ibf-geoserver:
# ports:
# - 8081:8080

ibf-local-db:
image: postgis/postgis
Expand Down
20 changes: 15 additions & 5 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
services:
nginx:
image: nginx
ports:
- 8080:80
volumes:
- ./tools/nginx.conf:/etc/nginx/conf.d/default.conf
- ./interfaces/IBF-dashboard/www/browser:/var/www/ibf-dashboard
networks:
- api-network
restart: unless-stopped

ibf-api-service:
command: ['npm', 'run', 'start:dev']
environment:
Expand All @@ -10,15 +21,14 @@ services:
depends_on:
- ibf-local-db
networks:
- web-server-network
- api-network

ibf-dashboard:
entrypoint: ['echo', 'Service ibf-dashboard disabled']
entrypoint: ['echo', 'ibf-dashboard is disabled']

ibf-geoserver:
ports:
- 8081:8080
# ibf-geoserver:
# ports:
# - 8081:8080

ibf-local-db:
image: postgis/postgis
Expand Down
32 changes: 7 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
services:
nginx:
image: staticfloat/nginx-certbot
ports:
- 80:80
- 443:443
environment:
CERTBOT_EMAIL: ${CERTBOT_EMAIL}
ENVSUBST_VARS: FQDN
FQDN: ${FQDN}
volumes:
- ./nginx/conf.d:/etc/nginx/user.conf.d
- ibf-dashboard-root:/var/www/ibf-dashboard
- ./nginx/letsencrypt:/etc/letsencrypt
networks:
web-server-network:
restart: unless-stopped

ibf-api-service:
container_name: ibf-api-service
build:
Expand Down Expand Up @@ -47,11 +30,12 @@ services:
- EXTERNAL_API_SERVICE_URL=${EXTERNAL_API_SERVICE_URL}
- TWILIO_WHATSAPP_NUMBER=${TWILIO_WHATSAPP_NUMBER}
- API_SERVICE_URL=${API_SERVICE_URL}
ports:
- 3000:3000
volumes:
- 'api_service_node_modules:/home/ibf/api-service/node_modules'
- ./services/API-service:/home/ibf/api-service
networks:
web-server-network:
api-network:
restart: unless-stopped

Expand Down Expand Up @@ -83,31 +67,29 @@ services:
- SUPPORT_EMAIL_ADDRESS=${SUPPORT_EMAIL_ADDRESS}
- WHATS_NEW_URL=${WHATS_NEW_URL}
volumes:
- ibf-dashboard-root:/home/node/app/www/browser
networks:
web-server-network:
- ibf_dashboard_node_modules:/home/node/app/node_modules
- ${BUILD_OUTPUT_PATH}:/home/node/app/www

ibf-geoserver:
container_name: ibf-geoserver
image: kartoza/geoserver:2.19.2
environment:
- GEOSERVER_ADMIN_PASSWORD=${GEOSERVER_ADMIN_PASSWORD}
- JAVA_OPTS="-DALLOW_ENV_PARAMETRIZATION=true"
ports:
- 8081:8080
volumes:
- ./services/API-service/geoserver-volume/raster-files:/opt/geoserver/data_dir/workspaces/ibf-system/ibf-pipeline
- ./services/API-service/geoserver-volume/geoserver-layers:/opt/geoserver/data_dir/workspaces/ibf-system
- ./.env:/opt/geoserver/data_dir/geoserver-environment.properties
networks:
web-server-network:
api-network:
restart: unless-stopped

volumes:
ibf-dashboard-root:
api_service_node_modules:
ibf_dashboard_node_modules:

networks:
web-server-network:
driver: bridge
api-network:
driver: bridge
18 changes: 16 additions & 2 deletions docs/VM_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@
1. Follow instructions in Source for Node 16
2. Verification - `node -v`
2. Docker [Source](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository)
1. Follow instructions in Source all th
1. Follow instructions in Source
2. Verification - `docker -v`
3. Allow users to access docker commands
1. `sudo usermod -aG docker <username>`
2. Verification - `grep docker /etc/group`
3. Nginx [Source](https://ubuntu.com/tutorials/install-and-configure-nginx#2-installing-nginx)
1. Follow instructions in Source
2. Verification - `nginx -v`
3. Setup IBF-system
1. `cd /home/ibf-user`
2. `git clone https://github.com/rodekruis/IBF-system.git`
Expand All @@ -61,7 +64,18 @@
3. Load the `.env` vars by `source /home/ibf-user/IBF-system/.env`
4. Test if the vars were loaded correctly `echo $NODE_ENV`
8. Load certificate: load `DigiCertGlobalRootCA.crt.pem` in `services/API-service/cert` for connection to Azure Postgres server (if applicable)
9. `. tools/deploy.sh`
9. Set up Nginx
1. `cp tools/nginx.conf /etc/nginx/conf.d/default.conf`
2. `nano /etc/nginx/conf.d/default.conf`
1. and switch lines with http://ibf-api-service or http://ibf-geoserver to http://localhost
2. and update `server_name` to e.g. `ibf-test.510.global`
3. `sudo service nginx restart`
4. Verification - `service nginx status`
5. Set up nginx directory
1. `sudo mkdir /var/www/ibf-dashboard`
2. `sudo chmod -R 777 /var/www/ibf-dashboard`
3. `sudo chown -R $(id -u):$(id -g) /var/www/ibf-dashboard`
10. `. tools/deploy.sh`
4. Load base data

1. Load Geoserver source data
Expand Down
5 changes: 1 addition & 4 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# nginx
CERTBOT_EMAIL=
FQDN=

# services/API-service
DB_HOST=ibf-local-db #docker.for.mac.localhost
DB_PORT=5432 #5437
Expand Down Expand Up @@ -29,6 +25,7 @@ GEOSERVER_ADMIN_PASSWORD=

# interfaces/IBF-dashboard
NG_CONFIGURATION=
BUILD_OUTPUT_PATH=/var/www/ibf-dashboard (this should be the path that tools/nginx.conf is also pointing to)
NG_USE_SERVICE_WORKER=
NG_GEOSERVER_URL=
NG_IBF_SYSTEM_VERSION=
Expand Down
2 changes: 1 addition & 1 deletion interfaces/IBF-dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ ENV SUPPORT_EMAIL_ADDRESS=$SUPPORT_EMAIL_ADDRESS
ARG WHATS_NEW_URL
ENV WHATS_NEW_URL=$WHATS_NEW_URL

RUN npm run build -- --configuration $NG_CONFIGURATION
CMD ["sh", "-c", "npm run build -- --configuration $NG_CONFIGURATION"]
44 changes: 40 additions & 4 deletions interfaces/IBF-dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion interfaces/IBF-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint:check": "ng lint",
"lint": "npx npm-run-all --print-label --parallel lint:check format:check",
"ng": "ng",
"postbuild:prod": "npm run compress",
"postbuild": "npm run compress",
"prebuild": "npm run set-env-variables",
"prestart": "npm install --no-audit --no-fund",
"serve:static": "cp www/browser/index.html www/browser/404.html && npx http-server www/browser/ -c-1 --gzip --port 4200",
Expand Down Expand Up @@ -101,5 +101,8 @@
"typescript": "^5.4.5",
"typescript-eslint": "^8.11.0",
"xlsx": "^0.18.5"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-musl": "^4.24.0"
}
}
Loading