added docker configuration

This commit is contained in:
fanir 2022-01-26 00:44:39 +01:00
parent 3cc7282183
commit feee1184d6
4 changed files with 79 additions and 0 deletions

24
.dockerignore Normal file
View File

@ -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

16
Dockerfile Normal file
View File

@ -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

29
docker-compose.debug.yml Normal file
View File

@ -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:

10
docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: '3.4'
services:
feedizer:
image: feedizer
build:
context: .
dockerfile: ./Dockerfile
ports:
- 3000:3000