Skip to content

icosa-foundation/icosa-gallery

Repository files navigation

Icosa API

Repository for Icosa API

Docker quick start

Copy the following files:

  • cp example.env .env
  • cp fastapi/config.example.json fastapi/config.json
  • cp fastapi/gcp-service-account.example.json fastapi/gcp-service-account.json

Or create and fill them in manually.

When running in docker, the api service needs its host specified as db instead of localhost where db is the postgres service name. This is currently set in the dblocation key inside config.json.

Before running for the first time, build the project:

docker compose build

Then:

docker compose up -d

TODO: When running docker compose up -d for the first time, the api service may start before postgres is fully available and fail to start. Subsequent runs should work as expected.

Services

Direct from localhost

  • web front end: localhost:3000
  • fastapi backend: localhost:8000
  • django backend: localhost:8001

Using the included proxy

Let's say, you've set DEPLOYMENT_HOST in .env to icosa.localhost, you can access the following services thus:

You'll need to add the following line to your /etc/hosts file (or the equivalent on Windows):

127.0.0.1 icosa.localhost

Seeding the database

If you have a .dump file, you can import it:

docker cp <db.dump> ig-db:/opt/

docker exec -it ig-db bash

pg_restore --data-only -U icosa -d icosa /opt/<db.dump>

Running updated versions of the code

There are 3 scenarios and respective actions to take:

You've updated your .env files

docker compose down

docker compose build

docker compose up

Incoming code has updated requirements.txt/requirements.in

docker compose down

docker compose build

docker compose up

Incoming code has updated anything else

docker compose restart

About

Icosa Gallery is a 3D model hosting solution, intended as a replacement for Google's Poly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project