Skip to content

Commit

Permalink
Fixes #127 - removed unnecessary backend components, added docker run…
Browse files Browse the repository at this point in the history
… to README
  • Loading branch information
Steven Hollingsworth committed May 12, 2023
1 parent a3fb5d9 commit 29c14cf
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 40 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ Trash AI is a web application where users can upload photos of litter, which wil

You can simply go to www.trashai.org to start using the tool or deploy it yourself. Current self-deployment options are local deployment with docker to remote on Amazon Web Services (AWS).

### [Run Local Docker Instance](https://hub.docker.com/r/code4sac/trashai)
```
docker run -p 5150:5150 -it code4sac/trashai:latest
```

### [Local Development](./docs/localdev.md)

- Run the environment live with localstack and docker.
Expand Down
3 changes: 2 additions & 1 deletion bin/runfrontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ IFS=$'\n\t'

export PATH="$PATH:/node_modules/.bin:/stack/bin:node_modules/.bin"

wait-for-it.sh -t 300 -h backend -p 4000
# Disabling until backend is needed
# wait-for-it.sh -t 300 -h backend -p 4000
cd /stack/frontend
while true; do
yarn
Expand Down
80 changes: 41 additions & 39 deletions localdev/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,62 @@
version: "3.9"

services:
localstack:
image: localstack/localstack:0.13.3
ports:
# - "127.0.0.1:53:53" # only required for Pro
# - "127.0.0.1:53:53/udp" # only required for Pro
# - "127.0.0.1:443:443" # only required for Pro
- "127.0.0.1:4510-4530:4510-4530"
- "127.0.0.1:4566:4566"
- "127.0.0.1:4571:4571"
environment:
- LOCALSTACK_TMP_FOLDER=/tmp/trash-ai-localstack-tmp/
- LOCALSTACK_DATA_DIR=/tmp/trash-ai-localstack-persist/
volumes:
- ${LOCALSTACK_TMP_FOLDER}:/tmp/localstack
- ${LOCALSTACK_DATA_DIR}:/tmp/localstack_persist
- "/var/run/docker.sock:/var/run/docker.sock"

restart: always
# Disabling backend components util needed again
# localstack:
# image: localstack/localstack:0.13.3
# ports:
# # - "127.0.0.1:53:53" # only required for Pro
# # - "127.0.0.1:53:53/udp" # only required for Pro
# # - "127.0.0.1:443:443" # only required for Pro
# - "127.0.0.1:4510-4530:4510-4530"
# - "127.0.0.1:4566:4566"
# - "127.0.0.1:4571:4571"
# environment:
# - LOCALSTACK_TMP_FOLDER=/tmp/trash-ai-localstack-tmp/
# - LOCALSTACK_DATA_DIR=/tmp/trash-ai-localstack-persist/
# volumes:
# - ${LOCALSTACK_TMP_FOLDER}:/tmp/localstack
# - ${LOCALSTACK_DATA_DIR}:/tmp/localstack_persist
# - "/var/run/docker.sock:/var/run/docker.sock"
#
# restart: always

build_img:
image: trash_ai_bs
build:
context: ../
dockerfile: localdev/Dockerfile

bootstrap:
image: trash_ai_bs
env_file: ./.env
volumes:
- ../:/stack
command: /stack/bin/runbootstrap.sh
depends_on:
- build_img
# Disabling backend components util needed again
# bootstrap:
# image: trash_ai_bs
# env_file: ./.env
# volumes:
# - ../:/stack
# command: /stack/bin/runbootstrap.sh
# depends_on:
# - build_img

backend:
image: trash_ai_bs
env_file: ./.env
volumes:
- ../:/stack
command: /stack/bin/runbackend.sh
links:
- "bootstrap"
ports:
- ${VITE_BACKEND_PORT}:${VITE_BACKEND_PORT}
restart: always
# backend:
# image: trash_ai_bs
# env_file: ./.env
# volumes:
# - ../:/stack
# command: /stack/bin/runbackend.sh
# links:
# - "bootstrap"
# ports:
# - ${VITE_BACKEND_PORT}:${VITE_BACKEND_PORT}
# restart: always

frontend:
image: trash_ai_bs
env_file: ./.env
volumes:
- ../:/stack
command: /stack/bin/runfrontend.sh
links:
- "backend"
# links:
# - "backend"

environment:
VITE_GOOGLE_MAPS_API_KEY: ${VITE_GOOGLE_MAPS_API_KEY-:"NOGOOGLEKEY"}
Expand Down

0 comments on commit 29c14cf

Please sign in to comment.