Skip to content

Commit

Permalink
adding bash scripts for docker, websocket using wss and file upload o…
Browse files Browse the repository at this point in the history
…n https, still getting 400 error on exhibit add_image
  • Loading branch information
root committed May 18, 2020
1 parent 8915cef commit 8744690
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


app = FastAPI()
app.add_middleware(HTTPSRedirectMiddleware)
#app.add_middleware(HTTPSRedirectMiddleware)

app_path = Path.cwd()
static_path = app_path / "site" / "assets"
Expand Down
2 changes: 1 addition & 1 deletion app/templates/edit_exhibit.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ <h4 class="modal-title">Edit Item</h4>
if (typeof files !== "undefined") {
fd.append('file',files);
fd.append('filename', files.name);
request.open("POST", "http://{{ meta.url }}/item_images");
request.open("POST", "https://{{ meta.url }}/item_images");
request.send(fd);
let ur = request.response;
let url = ur.slice(2,-2);
Expand Down
25 changes: 25 additions & 0 deletions start_docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
docker build -t blini .
docker run -d -p 80:80 -p 443:443 \
--name nginx-proxy \
-v $HOME/certs:/etc/nginx/certs:ro \
-v /etc/nginx/vhost.d \
-v /usr/share/nginx/html \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
--label com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true \
jwilder/nginx-proxy

docker run -d \
--name nginx-letsencrypt \
--volumes-from nginx-proxy \
-v $HOME/certs:/etc/nginx/certs:rw \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
jrcs/letsencrypt-nginx-proxy-companion

docker run -d \
--name blini \
-e '[email protected]' \
-e 'LETSENCRYPT_HOST=blini.apjan.co' \
-e 'VIRTUAL_HOST=blini.apjan.co' blini

echo "🐳 Successfully started docker 🐳"

8 changes: 8 additions & 0 deletions stop_docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
docker stop blini
docker stop nginx-letsencrypt
docker stop nginx-proxy
docker rm blini
docker rm nginx-letsencrypt
docker rm nginx-proxy
echo "🐳 Successfully stopped docker 🐳"

0 comments on commit 8744690

Please sign in to comment.