Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Websoft9/docker-library into…
Browse files Browse the repository at this point in the history
… dev
  • Loading branch information
qiaofeng1227 committed Sep 26, 2024
2 parents 6abe41a + 40dcf9e commit 3186ce7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 33 deletions.
8 changes: 4 additions & 4 deletions apps/danswer/.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ W9_POWER_PASSWORD=uQ8E1wVTzHH8SOk3!

#### -- Not allowed to edit below environments when recreate app based on existing data -- ####
W9_ID=danswer
W9_HTTP_PORT=3000
W9_HTTP_PORT=80
W9_HTTP_PORT_SET=9001

W9_DB_EXPOSE="postgresql"

W9_ADMIN_PATH="/admin/indexing/status"
W9_URL=appname.example.com
W9_URL_WITH_PORT=true
W9_URL_REPLACE=true
W9_NETWORK=websoft9
#### --------------------------------------------------------------------------------------- ####

## --------environmnet from danswer -----------
# Could be something like danswer.companyname.com
WEB_DOMAIN=http://$W9_URL
#WEB_DOMAIN=http://$W9_URL

# NOTE: Generative AI configurations are done via the UI now

Expand Down
30 changes: 3 additions & 27 deletions apps/danswer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ services:

web_server:
image: danswer/danswer-web-server:${W9_VERSION:-latest}
container_name: $W9_ID
container_name: $W9_ID-web-server
depends_on:
- api_server
restart: always
# ports:
# - "${W9_HTTP_PORT_SET}:3000"
env_file:
- .env
environment:
Expand Down Expand Up @@ -143,9 +141,6 @@ services:
image: vespaengine/vespa:8.277.17
container_name: danswer-index-$W9_HTTP_PORT_SET
restart: always
# ports:
# - "19071:19071"
# - "8081:8081"
volumes:
- vespa_volume:/opt/vespa/var
logging:
Expand All @@ -156,48 +151,29 @@ services:

nginx:
image: nginx:1.23.4-alpine
container_name: $W9_ID-nginx
container_name: $W9_ID
restart: always
depends_on:
- api_server
- web_server
ports:
- "${W9_HTTP_PORT_SET}:80"
#- "443:443"
volumes:
- ./src:/etc/nginx/conf.d
# - ../data/certbot/conf:/etc/letsencrypt
# - ../data/certbot/www:/var/www/certbot
logging:
driver: json-file
options:
max-size: "50m"
max-file: "6"
command: >
/bin/sh -c "dos2unix /etc/nginx/conf.d/run-nginx.sh && /etc/nginx/conf.d/run-nginx.sh app.conf.template"
/bin/sh -c "chmod +x /etc/nginx/conf.d/run-nginx.sh && dos2unix /etc/nginx/conf.d/run-nginx.sh && /etc/nginx/conf.d/run-nginx.sh app.conf.template"
env_file:
- .env

# follows https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71
# certbot:
# image: certbot/certbot
# restart: always
# volumes:
# - ../data/certbot/conf:/etc/letsencrypt
# - ../data/certbot/www:/var/www/certbot
# logging:
# driver: json-file
# options:
# max-size: "50m"
# max-file: "6"
# entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"

cache:
image: redis:7.4-alpine
container_name: $W9_ID-cache
restart: always
# ports:
# - '6379:6379'
command: redis-server --save "" --appendonly no

volumes:
Expand Down
2 changes: 1 addition & 1 deletion apps/danswer/src/app.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ upstream api_server {
}

upstream web_server {
server ${W9_ID}:3000 fail_timeout=0;
server ${W9_ID}-web-server:3000 fail_timeout=0;
}

server {
Expand Down
2 changes: 1 addition & 1 deletion apps/danswer/src/run-nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ envsubst '$DOMAIN $SSL_CERT_FILE_NAME $SSL_CERT_KEY_FILE_NAME $W9_ID' < "/etc/ng
echo "Waiting for API server to boot up; this may take a minute or two..."
echo "If this takes more than ~5 minutes, check the logs of the API server container for errors with the following command:"
echo
echo "docker logs ${$W9_ID}-api-server"
echo "docker logs ${W9_ID}-api-server"
echo

while true; do
Expand Down

0 comments on commit 3186ce7

Please sign in to comment.