| Field | Type | Reference |
|---|---|---|
| ID | int64 | json:"id" |
| Name | string | json:"name" |
| Location | string | json:"location" |
| Age | int64 | json:"age" |
curl -d '{"name":"paulo", "location":"rio", "age":38}' -H "Content-Type: application/json" -X POST http://localhost:8080/api/newuser
curl -d '{"name":"pedro", "location":"rio", "age":38}' -H "Content-Type: application/json" -X PUT http://localhost:8080/api/user/{id}
curl -H "Content-Type: application/json" -X GET http://localhost:8080/api/user
curl -H "Content-Type: application/json" -X GET http://localhost:8080/api/user/{id}
curl -H "Content-Type: application/json" -X DELETE http://localhost:8080/api/deleteuser/{id}
POSTGRES_URL=postgres://user:pass@<db-host-ip-addr>:5432/databasename?sslmode=disable
git clone https://github.com/paulovigne/goapp.git
cd goapp
docker build -t goapp-crud .
mkdir -p /postgresql
chown -R 1001:1001 /postgresql
docker run \
--name postgresql \
-e POSTGRESQL_USERNAME=goappuser \
-e POSTGRESQL_PASSWORD=goapppass \
-e POSTGRESQL_DATABASE=goappdb \
-p 5432:5432 \
-v /postgresql:/bitnami/postgresql/data \
quay.io/bitnami/postgresql:13
docker run \
--name=migrate \
-e POSTGRES_URL=postgres://goappuser:goapppass@<db-host-ip-addr>:5432/goappdb?sslmode=disable \
goapp-crud \
/app/migrate
docker run -d \
--name=goapp \
-p 8080:8080 \
-e POSTGRES_URL=postgres://goappuser:goapppass@<db-host-ip-addr>:5432/goappdb?sslmode=disable \
goapp-crud
Content type
Image
Digest
sha256:284859493…
Size
61.7 MB
Last updated
over 3 years ago
docker pull paulovigne/goapp-crud