Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e85c407453 | ||
|
|
e004afa806 |
No files matched your search
@@ -65,5 +65,8 @@ ENV AUTH_PROVIDERS='credentials'
|
||||
ENV REDIS_IS_EXTERNAL='false'
|
||||
ENV NODE_ENV='production'
|
||||
|
||||
ARG PORT=7575
|
||||
EXPOSE ${PORT}
|
||||
|
||||
ENTRYPOINT [ "/app/entrypoint.sh" ]
|
||||
CMD ["sh", "run.sh"]
|
||||
@@ -9,7 +9,7 @@
|
||||
"dev": "pnpm with-env next dev",
|
||||
"format": "oxfmt .",
|
||||
"lint": "oxlint",
|
||||
"start": "pnpm with-env next start",
|
||||
"start": "pnpm with-env next start -p ${PORT:-3000}",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"with-env": "dotenv -e ../../.env --"
|
||||
},
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
:: Please do not run this command in production. It is only for local testing.
|
||||
docker run -p 7575:7575 -e SECRET_ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000 homarr:latest
|
||||
docker run -p 7575:7575 -e PORT=7575 -e SECRET_ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000 homarr:latest
|
||||
+3
-5
@@ -4,10 +4,9 @@ events {
|
||||
|
||||
http {
|
||||
server {
|
||||
listen 7575;
|
||||
listen [::]:7575;
|
||||
listen ${PORT};
|
||||
listen [::]:${PORT};
|
||||
|
||||
# Route websockets traffic to port 3001
|
||||
location /websockets {
|
||||
proxy_pass http://${HOSTNAME}:3001;
|
||||
proxy_http_version 1.1;
|
||||
@@ -16,9 +15,8 @@ http {
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
|
||||
# Route all other traffic to port 3000
|
||||
location / {
|
||||
proxy_pass http://${HOSTNAME}:3000;
|
||||
proxy_pass http://${HOSTNAME}:${INTERNAL_NEXTJS_PORT};
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
|
||||
+5
-6
@@ -17,12 +17,11 @@ fi
|
||||
# Auth secret is generated every time the container starts as it is required, but not used because we don't need JWTs or Mail hashing
|
||||
export AUTH_SECRET=$(openssl rand -base64 32)
|
||||
|
||||
# Start nginx proxy
|
||||
# 1. Replace the HOSTNAME in the nginx template file
|
||||
# 2. Create the nginx configuration file from the template
|
||||
# 3. Start the nginx server
|
||||
export PORT=${PORT:-7575}
|
||||
export INTERNAL_NEXTJS_PORT=7901
|
||||
|
||||
export HOSTNAME
|
||||
envsubst '${HOSTNAME}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
|
||||
envsubst '${HOSTNAME} ${PORT} ${INTERNAL_NEXTJS_PORT}' < /etc/nginx/templates/nginx.conf > /etc/nginx/nginx.conf
|
||||
# Start services in the background and store their PIDs
|
||||
nginx -g 'daemon off;' &
|
||||
NGINX_PID=$!
|
||||
@@ -36,7 +35,7 @@ else
|
||||
REDIS_PID=$!
|
||||
fi
|
||||
|
||||
node apps/nextjs/server.js &
|
||||
PORT=$INTERNAL_NEXTJS_PORT node apps/nextjs/server.js &
|
||||
NEXTJS_PID=$!
|
||||
|
||||
# Function to handle SIGTERM and shut down services
|
||||
|
||||
Reference in new issue
Block a user