From feee1184d677178fcc0d70301dfa4ab06f866b8d Mon Sep 17 00:00:00 2001 From: Fanir Date: Wed, 26 Jan 2022 00:44:39 +0100 Subject: [PATCH] added docker configuration --- .dockerignore | 24 ++++++++++++++++++++++++ Dockerfile | 16 ++++++++++++++++ docker-compose.debug.yml | 29 +++++++++++++++++++++++++++++ docker-compose.yml | 10 ++++++++++ 4 files changed, 79 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.debug.yml create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..95520b4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,24 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..980ee35 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +#build stage +FROM golang:1.17-alpine AS builder +RUN apk add --no-cache git +WORKDIR /go/src/app +COPY . . +WORKDIR /go/src/app/cmd/feedizer +RUN go build -o /go/bin/app -v . + +#final stage +FROM alpine:latest +RUN apk --no-cache add ca-certificates +COPY --from=builder /go/bin/app /app +ENV FEEDIZER_ALLOWROOT=1 +ENTRYPOINT /app +LABEL Name=feedizer Version=0.0.1 +EXPOSE 3000 diff --git a/docker-compose.debug.yml b/docker-compose.debug.yml new file mode 100644 index 0000000..7eb65f0 --- /dev/null +++ b/docker-compose.debug.yml @@ -0,0 +1,29 @@ +version: '3.4' + +services: + db: + image: postgres:14-alpine + environment: + POSTGRES_USER: feedizer + POSTGRES_PASSWORD: feedizer + POSTGRES_DB: feedizer + + app: + image: feedizer + build: + context: . + dockerfile: ./Dockerfile + depends_on: + - db + ports: + - 3000:3000 + environment: + FEEDIZER_DATABASE_HOST: db + FEEDIZER_DATABASE_PORT: 5432 + FEEDIZER_DATABASE_USERNAME: feedizer + FEEDIZER_DATABASE_PASSWORD: feedizer + FEEDIZER_DATABASE_DATABASE: feedizer + FEEDIZER_DATABASE_OPTIONS: sslmode=disable + FEEDIZER_SERVER_ADDRESS: :3000 + FEEDIZER_SERVER_TEMPLATEDIR: + FEEDIZER_SERVER_STATICDIR: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..daa8aea --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.4' + +services: + feedizer: + image: feedizer + build: + context: . + dockerfile: ./Dockerfile + ports: + - 3000:3000