Skip to content

A fully automated Postgres container with a Fastify server for API calls. Everything happens inside Docker. No need to install software on your computer.

Notifications You must be signed in to change notification settings

turq84/fastify-postgres-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is fully automated. You should not have to download any additional software to your computer.

Getting Started

Docker

To run the Docker container, in your terminal run docker-compose up --build or, as an alternative, npm start.

Once the Docker container is running, visit localhost:3000 to get the 'Hello World!' test message.

Postgres

To get into the running postgres db (requires docker), run npm run psql.

Data Tables

To add more tables to your database, go to db -> init.sql. There you can add all of your tables. The tables will be created when the Docker container is being built.

Routes

To add your routes, go to app -> routes.js. Use the examples there to help you.

Recommendations

I highly recommend adding some security to your routes. You need to protect your database from bad actors. One suggestion is JWT.

Thanks

This project was inspired by the work of Francesco Ciulla with his study-with-me-fastify-docker project.

About

A fully automated Postgres container with a Fastify server for API calls. Everything happens inside Docker. No need to install software on your computer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published