mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 09:26:17 -05:00
Restoring development nginx config. Reverting react-timezone-select version to avoid compilation error.
This commit is contained in:
parent
e6f477802a
commit
7e0fcb2577
5 changed files with 65 additions and 12 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
53
nginx.dev.conf
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue