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 db
docker 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 ps
anddocker stop <container-id>
to shut it down.
To run the app locally:
cd app
npm install
npm 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 app
docker 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:/fossils
with the path where you've cloned this repo. - API will be accessible via http://localhost:3001/api.
- Container will be left running; use
docker ps
anddocker stop <container-id>
to shut it down.
To build the frontend locally:
cd frontend
npm install
npm run build:dev
(production:npm run build
)- Webpack build artifacts will be in
frontend/public
.
To build and serve the frontend with Docker:
cd frontend
docker 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:/fossils
with the path where you've cloned this repo. - Frontend will be accessible via http://localhost:3002.
- Container will be left running; use
docker ps
anddocker 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.