A handy tool for tracking fossil collection among friends in Animal Crossing: New Horizons.
To build and run all containers, using docker-compose:
- Production:
docker-compose up --build - Development:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build - Frontend will be accessible via http://localhost:3000.
The database volume (fossils_pgdata) will persist after shutting down; you can purge it with docker-compose down -v to clear all data and start fresh on your next run.
To spin up a database container in Docker for testing:
cd dbdocker volume create pgtest(Will persist; remove withdocker volume rm pgtest)docker build -t fossils-db .docker run -p 5442:5432 -v pgtest:/var/lib/postgresql/data -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres fossils-db- Connect a postgres terminal with
psql -p 5442 -U postgres -d postgres(password ispostgres). - Container will be left running; use
docker psanddocker stop <container-id>to shut it down.
To run the app locally:
cd appnpm installnpm run start:dev(production:npm run start)- API will be accessible via http://localhost:8080/api.
To build and run the app with Docker:
cd appdocker build -t fossils-app:dev -f Dockerfile-dev .(production:docker build -t fossils-app .)docker run -p 3001:8080 -v e:/fossils/app:/usr/src/app fossils-app:dev(production:docker run -p 3001:8080 fossils-app)- Replace
e:/fossilswith the path where you've cloned this repo. - API will be accessible via http://localhost:3001/api.
- Container will be left running; use
docker psanddocker stop <container-id>to shut it down.
To build the frontend locally:
cd frontendnpm installnpm run build:dev(production:npm run build)- Webpack build artifacts will be in
frontend/public.
To build and serve the frontend with Docker:
cd frontenddocker build -t fossils-frontend:dev -f Dockerfile-dev .(production:docker build -t fossils-frontend .)docker run -p 3002:8080 -v e:/fossils/frontend/src:/usr/src/app/src fossils-frontend:dev(production:docker run -p 3002:8080 fossils-frontend)- Replace
e:/fossilswith the path where you've cloned this repo. - Frontend will be accessible via http://localhost:3002.
- Container will be left running; use
docker psanddocker stop <container-id>to shut it down.
The nginx container sits in front of the backend app and the frontend, and serves as a reverse proxy to route requests to the appropriate service.