diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..03b3af7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM golang:latest + +RUN apk add --no-cache pandoc + +WORKDIR /var/www/cpolis + +COPY . . + +RUN go build -o cpolis cmd/main.go + +CMD ["./cpolis"] diff --git a/cmd/backend/config.go b/cmd/backend/config.go index 1a1dabf..3a28519 100644 --- a/cmd/backend/config.go +++ b/cmd/backend/config.go @@ -51,8 +51,8 @@ func newConfig() *Config { MaxImgWidth: 1920, PDFDir: "/var/www/cpolis/pdfs", PicsDir: "/var/www/cpolis/pics", - Port: ":8080", - Version: "v0.15.3", + Port: ":1664", + Version: "v0.16.0", WebDir: "/var/www/cpolis/web", } } diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1c3e265 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +services: + app: + build: . + ports: + - "1664:1664" + volumes: + - /path/to/serviceAccountKey.json:/var/www/cpolis/serviceAccountKey.json + - /var/log/cpolis.log:/var/log/cpolis.log + depends_on: + - db + + db: + image: mariadb:latest + environment: + MYSQL_ROOT_PASSWORD: example + MYSQL_DATABASE: cpolis + MYSQL_USER: exampleuser + MYSQL_PASSWORD: examplepass + ports: + - "3306:3306" + volumes: + - ./path/to/create_db.sql:/docker-entrypoint-initdb.d/create_db.sql