-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add docker compose with reverse proxy
- Loading branch information
1 parent
f19fa53
commit 65e7b6e
Showing
5 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
version: '3' | ||
|
||
|
||
services: | ||
gsas: | ||
image: gsas:conda | ||
build: | ||
context: ../gsas | ||
dockerfile: Containerfile-conda | ||
command: conda run -n GSASII --no-capture-output uvicorn bluesky_adaptive.server:app | ||
env: | ||
- BS_AGENT_STARTUP_SCRIPT_PATH: /src/pdf-agents/pdf_agents/startup_scripts/mmm5-tax-day/gsas.py | ||
volumes: | ||
- type: ro | ||
source: ../pdf_agents | ||
target: /src/pdf-agents/pdf_agents | ||
|
||
kmeans-gsas: | ||
image: bluesky:latest | ||
command: uvicorn bluesky_adaptive.server:app | ||
env: | ||
- BS_AGENT_STARTUP_SCRIPT_PATH: /src/pdf-agents/pdf_agents/startup_scripts/mmm5-tax-day/kmeans-gsas.py | ||
volumes: | ||
- type: ro | ||
source: ../pdf_agents | ||
target: /src/pdf-agents/pdf_agents | ||
depends_on: | ||
gsas: | ||
condition: service_started | ||
|
||
proxy: | ||
image: docker.io/nginx | ||
init: true | ||
ports: | ||
- "127.0.0.1:11973:11973" | ||
volumes: | ||
- type: ro | ||
source: ../nginx/nginx.conf | ||
target: /etc/nginx/nginx.conf | ||
- type: ro | ||
source: ../nginx/locs.d | ||
target: /etc/nginx/locs.d | ||
- type: ro | ||
source: ../nginx/html | ||
target: /var/www/html | ||
depends_on: | ||
gsas: | ||
condition: service_started | ||
kmeans-gsas: | ||
condition: service_started | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Landing Page for Agent Services</title> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f0f0f0; | ||
margin: 0; | ||
padding: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
text-align: center; | ||
} | ||
|
||
.container { | ||
background-color: #ffffff; | ||
padding: 20px; | ||
border-radius: 5px; | ||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
h1 { | ||
color: #333333; | ||
} | ||
|
||
p, | ||
a { | ||
color: #666666; | ||
} | ||
|
||
ul { | ||
list-style-type: none; | ||
padding: 0; | ||
} | ||
|
||
li { | ||
margin: 10px 0; | ||
} | ||
|
||
/* Add styles for your links here. For example, color, decoration, etc. */ | ||
a { | ||
text-decoration: none; | ||
color: #007BFF; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h1>Welcome!</h1> | ||
<p>This is the default landing page for our service. Please check back soon for updates.</p> | ||
|
||
<!-- Links to your services --> | ||
<h2>Our Services</h2> | ||
<ul> | ||
<!-- Link to the GSAS service --> | ||
<li><a href="/gsas/">GSAS Service</a></li> | ||
<!-- Link to the KMeans-GSAS service --> | ||
<li><a href="/kmeans-gsas/">KMeans-GSAS Service</a></li> | ||
<!-- Add more services here --> | ||
<!-- Example: <li><a href="/your-service/">Your Service Name</a></li> --> | ||
</ul> | ||
|
||
<!-- Instructions or additional information can go here --> | ||
<p>Click on the links above to access our services.</p> | ||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
location /gsas/ { | ||
proxy_pass http://gsas:8000/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_read_timeout 60s; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
location /kmeans-gsas/ { | ||
proxy_pass http://kmeans-gsas:8000/; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_read_timeout 60s; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
user nginx; | ||
worker_processes 1; | ||
|
||
error_log /var/log/nginx/error.log warn; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
|
||
server { | ||
listen 11973 default_server; | ||
listen [::]:11973 default_server; | ||
|
||
root /var/www/html; | ||
|
||
index index.html index.htm index.nginx-debian.html; | ||
|
||
server_name _; | ||
|
||
include /etc/nginx/locs.d/*.conf; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} | ||
} |