diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 0000000..47b331e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.17-alpine + +RUN apk update && apk add make git bash + +WORKDIR /var/www/status + +COPY . . +RUN make + +CMD ["/bin/bash", "-c", "go run generate.go && go run main.go"] + +RUN chown -R root:root /var/www/status/db + +EXPOSE 8798 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..f8aab96 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +services: + status: + build: . + ports: + - "8798:8000" + environment: + - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_DB}:5432/status?sslmode=disable + - ASSETS_DIR=/var/www/status/assets + volumes: + - .:/var/www/status:rw + - ./assets/style2.css:/var/www/status/assets/style.css + + db: + image: postgres:13 + restart: always + environment: + POSTGRES_USER: postgres # change me + POSTGRES_PASSWORD: password # change me + POSTGRES_DB: status + volumes: + - ./db:/var/lib/postgresql/data + ports: + - "5432:5432"