Restoring development nginx config. Reverting react-timezone-select version to avoid compilation error.

This commit is contained in:
Roland 2021-11-02 10:26:07 -06:00
parent e6f477802a
commit 7e0fcb2577
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
5 changed files with 65 additions and 12 deletions

View file

@ -1,5 +1,5 @@
{
"name": "app",
"name": "wrolpi-app",
"version": "0.1.0",
"private": true,
"dependencies": {
@ -12,7 +12,7 @@
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.1",
"react-semantic-toasts": "^0.6.5",
"react-timezone-select": "^1.0.5",
"react-timezone-select": "0.8.4",
"semantic-ui-offline": "^2.4.1-1",
"semantic-ui-react": "^0.88.2",
"yargs-parser": "^18.1.2"

View file

@ -8,6 +8,7 @@ services:
- POSTGRES_PASSWORD=wrolpi
ports:
- '54321:5432'
- '5432:5432'
healthcheck:
test: [ 'CMD-SHELL', 'pg_isready -U postgres' ]
@ -47,11 +48,11 @@ services:
build:
context: .
dockerfile: docker/app/Dockerfile
ports:
- '8082:8082'
volumes:
- './app:/app'
command: 'yarn start'
- './app/public:/app/public'
- './app/src:/app/src'
- './app/package.json:/app/package.json'
command: 'npm run start'
stdin_open: true
healthcheck:
test: [ 'CMD-SHELL', 'curl http://127.0.0.1:3000' ]
@ -64,7 +65,7 @@ services:
ports:
- ${WEB_HOST-0.0.0.0}:${WEB_PORT-8080}:80
volumes:
- './nginx.conf:/etc/nginx/nginx.conf'
- './nginx.dev.conf:/etc/nginx/nginx.conf'
- './icon.ico:/etc/nginx/favicon.ico'
- './icon.png:/etc/nginx/icon.png'
- './test:/opt/media'

View file

@ -10,10 +10,9 @@ COPY app/src /app/src
COPY app/package.json /app/
RUN rm -rf /app/node_modules
# Increase network timeout because a Raspberry Pi is slow.
RUN yarn --silent --network-timeout 100000
RUN yarn --network-timeout 100000
# Create the production build
RUN yarn run build
RUN yarn global add serve
# Run the production build

View file

@ -19,19 +19,19 @@ http {
location / {
# React APP
proxy_pass http://app:3000;
proxy_pass http://127.0.0.1:5000;
rewrite $1 break;
}
location /sockjs-node {
proxy_pass http://app:3000;
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location /api {
proxy_pass http://api:8081;
proxy_pass http://127.0.0.1:8081;
rewrite /^api(.*)$ $1 break;
}

53
nginx.dev.conf Normal file
View file

@ -0,0 +1,53 @@
events {
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
location /favicon.ico {
alias /etc/nginx/favicon.ico;
}
location /apple-touch-icon.png {
alias /etc/nginx/icon.png;
}
location / {
# React APP
proxy_pass http://app:3000;
rewrite $1 break;
}
location /sockjs-node {
proxy_pass http://app:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location /api {
proxy_pass http://api:8081;
rewrite /^api(.*)$ $1 break;
}
location /media {
# The media files mounted in the docker volume
sendfile on;
sendfile_max_chunk 1m;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
autoindex on;
autoindex_exact_size off;
alias /opt/media;
}
}
}