Skip to content

Commit

Permalink
Merge pull request #2 from viralparmarme/feature/docker
Browse files Browse the repository at this point in the history
Add docker support
  • Loading branch information
viralparmarme authored Sep 26, 2023
2 parents f57b2f5 + 45f6ac0 commit 910790b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 910790b

Please sign in to comment.