code4sac / trash-ai

Web based trash image classification

Home Page:https://www.trashai.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature]: Docker compose only deployment

wincowgerDEV opened this issue · comments

Guidelines

  • I agree to follow this project's Contributing Guidelines.

Description

Reviewer said: you directly build in the docker-compose file, so people need to clone the repository. If you would upload a pre-compiled container people could just download a docker-compose file and just run it from there. The container would be downloaded automatically from the repository and started.

Also your localdev really is an local development option and is not targeted for deployment. My idea was just to build one lean container which just serves the frontend so people can quickly run it on their desktop machines with docker desktop or on a local server with docker.

A simple Dockerfile could look like this:

FROM node:16.12.0 as builder
COPY . .
RUN yarn
RUN yarn build

FROM nginx:1.23.3
COPY --from=builder dist /usr/share/nginx/html
inside the frontend dir. This would just create an nginx based container with the frontend copied as static files into its public directory.

Problem

We may not need people to clone the whole repo.

Proposed Solution

Perhaps people could just use a single docker-compose file and we push everything to a docker container.

Alternatives Considered

Expect people to clone the whole repo.

@feydan Does the org have a docker registry?

There are two remaining items on this:
1.) pushing to docker registry during frontend build
2.) Fix the google api key during build process
3.) update README to reflect changes, remove uneeded localdev pieces because backend isn't being called right now.

All fixes have been implemented. Closing issue.