Make sure you have Bun installed on your computer.
To install dependencies:
bun install
npx lefthook install
To run:
bun start
or to run the compiled executable:
bun buildex
open http://localhost:3001
- Make sure you have Docker installed on your machine
- Fill the environment variables
- Run
docker build --pull -t [app_name] .
- If built successfully, run
docker run -p 3001:3001 [app_name]
- This will start running the app on localhost port 3001 so make sure you don't have any other application running on the same port.
- Now you can use and test the API by going to
http://localhost:3001/api/[version]/[endpoint]
- To stop the container run
docker stop <container-id-or-name>
(you can check the ID or name of the container by runningdocker ps
) - To remove the container run
docker rm <container-id-or-name>
- To remove the image and free up space on your locale machine run
docker rmi <image-id-or-repository:tag>
(you can check your images by runningdocker images
)
- When you build a new version of your Docker image using the docker build command, it does not automatically update the running container. The running container continues to use the image version it was originally started with. To use the latest version of your image, you need to stop and remove the existing container, and then start a new container based on the updated image.