phosphor-icons / server Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://api.phosphoricons.com/docs
Home Page: https://api.phosphoricons.com/docs
Hello Phosphor Icons team,
I am trying to self-host the Phosphor Icons server in a closed network environment where access to external CDNs is not possible. I believe the phosphor-icons/server repository is the perfect solution for this.
git clone --recurse-submodules [email protected]:phosphor-icons/server.git phosphor-icons-serverDATABASE_URL=postgresql://appuser:apppassword@localhost:5432/appdb
HOST=0.0.0.0
PORT=8080
sh start.shThe server should start correctly, and the API endpoint http://localhost:8080/v1/icons should return a list of icons.
The server starts, and the API documentation is available at http://localhost:8080/docs. However, when I make a request to http://localhost:8080/v1/icons, the application panics and returns an error.
The server log shows the following database error:
ERROR phosphor_server::icons: Failed to fetch icons for query: Query(SqlxError(Database(PgDatabaseError { severity: Error, code: "42P01", message: "relation \"icons\" does not exist", ... })))
This suggests that the database schema, specifically the icons table, has not been created. I suspect there is a database migration step that I might have missed in the documentation.
To provide more context, I am running a PostgreSQL 17 database instance using Docker. Here is my Dockerfile:
FROM postgres:17
ENV POSTGRES_USER=appuser
ENV POSTGRES_PASSWORD=apppassword
ENV POSTGRES_DB=appdb
EXPOSE 5432
I built and ran this container with the following commands:
docker build -t my-postgres17 .
docker run -d \
--name my-postgres17-container \
-p 5432:5432 \
my-postgres17
I then attempted to run the database migrations from my local machine (not inside the Docker container) by executing the following commands, but it did not resolve the issue:
# This was an attempt to run migrations, but it had no effect
cd migration && cargo run && cargo run -- up && cd ../
The error relation "icons" does not exist persists, which makes sense as the migration commands I tried seem incorrect and were not the standard sqlx-cli commands.
I am documenting my attempt to containerize this setup in my forked repository here: https://github.com/eckeriaue/phosphor-icons-server/tree/feat/use-docker
Could you please provide guidance on the correct procedure to initialize the database and run the necessary migrations?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
Personal AI Assistant
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.