This is a sample application implementing the TodoBackend functionality. It uses Testcontainers for setting up local environment for running the application.
- Clone this repository or download and unzip it:
git clone https://github.com/mdelapenya/docker-captains-go && cd docker-captains-go
- Run the application:
go run -tags dev -v ./...
- Open the application in the browser: link
- Run
docker ps
to see the database container running. - Check out dev_mode.go to see how Testcontainers is used to provide a development environment.
Optionally:
- Install Testcontainers Desktop (free)
- Configure Postgres service in the Testcontainers Desktop app
- Connect to the database from your IDE / database viewer using.
- Open terminal to the service (from the taskbar app menu):
- Run:
psql -U postgres todos
to connect to the database - Execute:
select * from todos;
to see your data.
- Go 1.21
- Docker environment