From 42440feab2ce03ca3a68651218d602260405460a Mon Sep 17 00:00:00 2001 From: talksik Date: Sun, 1 Oct 2023 14:25:51 -0700 Subject: [PATCH] adding in docker and such --- Dockerfile | 10 ++++++++++ Makefile | 3 +++ main.go => cmd/main.go | 0 docker-compose.yaml | 12 ++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile rename main.go => cmd/main.go (100%) create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..52bfb45 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.21 AS builder +COPY / /app + +WORKDIR /app/cmd +RUN CGO_ENABLED=0 GOOS=linux go build -o main + +FROM alpine:latest AS production +COPY --from=builder /app/cmd . +CMD ["./main"] + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d762bc9 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ + +run: + go run cmd/main.go diff --git a/main.go b/cmd/main.go similarity index 100% rename from main.go rename to cmd/main.go diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..45a0502 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,12 @@ +version: '3' +services: + flowy-landing: + build: + context: . + dockerfile: Dockerfile + ports: + - 3000:3000 + volumes: + - /etc/data/flowy-landing/users.db:./users.db + +