Add the ability to run cpolis from docker
This commit is contained in:
parent
86a16629fd
commit
6885dfbb38
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@ -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"]
|
@ -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",
|
||||
}
|
||||
}
|
||||
|
22
docker-compose.yml
Normal file
22
docker-compose.yml
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user