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

set fixed ip and port number for the web server for elestio #58

Closed
wants to merge 7 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
2 changes: 1 addition & 1 deletion deployment/docker_compose/docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
dockerfile: Dockerfile
command: >
/bin/sh -c "alembic upgrade head &&
echo \"Starting Danswer Api Server\" &&
echo \"Starting enMedD AI Api Server\" &&
uvicorn danswer.main:app --host 0.0.0.0 --port 8080"
depends_on:
- relational_db
Expand Down
10 changes: 5 additions & 5 deletions deployment/docker_compose/init-letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fi
echo "### Creating dummy certificate for $domains ..."
path="/etc/letsencrypt/live/$domains"
mkdir -p "$data_path/conf/live/$domains"
$COMPOSE_CMD -f docker-compose.prod.yml run --name danswer-stack --rm --entrypoint "\
$COMPOSE_CMD -f docker-compose.prod.yml run --name enmedd-stack --rm --entrypoint "\
openssl req -x509 -nodes -newkey rsa:$rsa_key_size -days 1\
-keyout '$path/privkey.pem' \
-out '$path/fullchain.pem' \
Expand All @@ -61,7 +61,7 @@ echo


echo "### Starting nginx ..."
$COMPOSE_CMD -f docker-compose.prod.yml -p danswer-stack up --force-recreate -d nginx
$COMPOSE_CMD -f docker-compose.prod.yml -p enmedd-stack up --force-recreate -d nginx
echo

echo "Waiting for nginx to be ready, this may take a minute..."
Expand All @@ -79,7 +79,7 @@ while true; do
done

echo "### Deleting dummy certificate for $domains ..."
$COMPOSE_CMD -f docker-compose.prod.yml run --name danswer-stack --rm --entrypoint "\
$COMPOSE_CMD -f docker-compose.prod.yml run --name enmedd-stack --rm --entrypoint "\
rm -Rf /etc/letsencrypt/live/$domains && \
rm -Rf /etc/letsencrypt/archive/$domains && \
rm -Rf /etc/letsencrypt/renewal/$domains.conf" certbot
Expand All @@ -102,7 +102,7 @@ esac
# Enable staging mode if needed
if [ $staging != "0" ]; then staging_arg="--staging"; fi

$COMPOSE_CMD -f docker-compose.prod.yml run --name danswer-stack --rm --entrypoint "\
$COMPOSE_CMD -f docker-compose.prod.yml run --name enmedd-stack --rm --entrypoint "\
certbot certonly --webroot -w /var/www/certbot \
$staging_arg \
$email_arg \
Expand All @@ -113,4 +113,4 @@ $COMPOSE_CMD -f docker-compose.prod.yml run --name danswer-stack --rm --entrypoi
echo

echo "### Reloading nginx ..."
$COMPOSE_CMD -f docker-compose.prod.yml -p danswer-stack up --force-recreate -d
$COMPOSE_CMD -f docker-compose.prod.yml -p enmedd-stack up -d --build --force-recreate
2 changes: 2 additions & 0 deletions docker-compose.elestio.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
restart: always
ports:
- "8080:8080"
network_mode: host
environment:
# Auth Settings
- AUTH_TYPE=${AUTH_TYPE:-disabled}
Expand Down Expand Up @@ -212,6 +213,7 @@ services:
depends_on:
- api_server
restart: always
network_mode: host
environment:
- INTERNAL_URL=http://api_server:8080
- WEB_DOMAIN=${WEB_DOMAIN:-}
Expand Down
4 changes: 3 additions & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,7 @@ ENV NEXT_PUBLIC_DISABLE_LOGOUT=${NEXT_PUBLIC_DISABLE_LOGOUT}
# expose is done for AWS deployment
EXPOSE 3000

CMD ["node", "server.js"]
ENV PORT=3000
ENV HOSTNAME=0.0.0.0

CMD ["node", "server.js"]
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"start": "next start -p 3000 -H 0.0.0.0",
"lint": "next lint"
},
"dependencies": {
Expand Down
Loading