diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4590eee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# build stage +FROM golang:1.23-alpine3.20 AS builder +WORKDIR /app +COPY . . +RUN go build -o main main.go + +# run stage +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 6e40cc4..09daf03 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ postgres: - docker run --name postgres -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -d postgres + docker run --name postgres16 --network bank-network -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -d postgres migrateup: migrate -path db/migrations -database "postgres://postgres:postgres@localhost:5432/bank?sslmode=disable" -verbose up