diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dbbcaad --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:1.21-alpine3.18 AS builder +WORKDIR /app +COPY . . +RUN go build -o main main.go + +FROM alpine:3.13 +WORKDIR /app +COPY --from=builder /app/main . +COPY app.env . +EXPOSE 8080 + +CMD ["/app/main"] \ No newline at end of file diff --git a/Makefile b/Makefile index 3d2c434..9a4c2ed 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ postgres: - docker run --name postgres12 -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:12-alpine + docker run --name postgres12 --network bank-net -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:12-alpine createdb: docker exec -it postgres12 createdb --username=root --owner=root simple_bank