add docker stuff
This commit is contained in:
parent
512983a0ff
commit
c3a061f987
2 changed files with 37 additions and 0 deletions
14
Dockerfile
Executable file
14
Dockerfile
Executable file
|
|
@ -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
|
||||
23
docker-compose.yml
Executable file
23
docker-compose.yml
Executable file
|
|
@ -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"
|
||||
Loading…
Reference in a new issue