- Node
- Docker
sudo /etc/hosts;
# 127.0.0.1 www.localdomain.com
# 127.0.0.1 localdomain.com
# 127.0.0.1 sub.localdomain.com
# 127.0.0.1 api.localdomain.com
docker compose up -d;NOTE: To remove instance
docker compose down --remove-orphans -v;1 - Enter docker
docker exec -it proxy /bin/sh;2 - Generate SSL certs
apk add openssl;
openssl req -x509 -nodes -days 365 -subj \
"/C=CA/ST=QC/O=Company, Inc./CN=localdomain.com" \
-addext "subjectAltName=DNS:localdomain.com,DNS:sub.localdomain.com,DNS:www.localdomain.com,DNS:api.localdomain.com" \
-newkey rsa:2048 \
-keyout /tmp/nginx-selfsigned.key -out /tmp/nginx-selfsigned.crt;3 - Modify Nginx Conf
apk add nano;
``
```bash
nano default.conf;
File: default.conf
- #listen 443 ssl http2 default_server;
- #listen [::]:443 ssl http2 default_server;
- #ssl_certificate /tmp/nginx-selfsigned.crt;
- #ssl_certificate_key /tmp/nginx-selfsigned.key;
+ listen 443 ssl http2 default_server;
+ listen [::]:443 ssl http2 default_server;
+ ssl_certificate /tmp/nginx-selfsigned.crt;
+ ssl_certificate_key /tmp/nginx-selfsigned.key;To save
ctrl + x;
y;Restart nginx;
nginx -s reload;-
Drag
certs/nginx-selfassigned.crtto your Keychain Access -
Make sure you set it to fully trusted
localdomain.com/.env;
sub.localdomain.com/.env;
yarn build;NOTE: If you have to make changes to the SPA React apps you will need to rebuild and re-serve
# localdomain.com
npx http-server -p 3000 dist;# sub.localdomain.com
npx http-server -p 3001 dist;