add docker files

This commit is contained in:
Krzysztof
2025-08-03 14:20:47 +02:00
parent 17cabd68ad
commit 50a46d8ad9
6 changed files with 61 additions and 30 deletions

24
Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
FROM golang:latest AS builder
WORKDIR /app
COPY . .
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -o uptimemonitor \
-ldflags "-X uptimemonitor/pkg/version.Version=$(git describe --tags)" \
./cmd/uptimemonitor
FROM alpine:latest
WORKDIR /app
RUN apk add --no-cache ca-certificates
COPY --from=builder /app/uptimemonitor .
EXPOSE 3000
CMD ["./uptimemonitor"]

View File

@@ -33,6 +33,9 @@ chmod +x uptimemonitor
./uptimemonitor -addr=":3000"
```
You can also use provided `Dockerfile` and `docker-compose.yml` for reference to
run the app using Docker.
## First run
When you first run the application you will be asked to create a new account,
@@ -85,3 +88,13 @@ small donation- please use Github Sponsors.
The donations of $50 a month and above will be featured in a sponsors area
inside the application dashboard.
## Roadmap
- Monitor status badges
- Change password
- Manage users
- Timezones
- Reset password via cli
- Add "Test Webhook" button with fake incident
- Sort monitors option (with localstorage sync) by created_at/name(domain)

29
TODO.md
View File

@@ -1,29 +0,0 @@
# TODO
What's left to do:
- [ ] Get app version from git tag
- [ ] Add documentation
- [ ] Document how to install
- [ ] Document webhook parsing and available variables
- [ ] Release 🎉
Optional:
- [ ] Monitor status
- [ ] Change password
- [ ] Add users
- [ ] Remove users
- [ ] Change user passwords
- [ ] Timezones
- [ ] Reset password via cli
- [ ] Use the same form for creation and editing of monitor
- [ ] Save check response
- [ ] Add check response modal (div#modals + append when clicked + destroy when
clicked)
- [ ] Mobile breadcrumbs (dropdown/select)
- [ ] Add "Test Webhook" button with fake incident
- [ ] Sort monitors option (with localstorage sync) by created_at/name(domain)
- [ ] Session expiration
- [ ] Test check timeout
- [ ] Loading placeholders (skeletons)

View File

@@ -23,12 +23,16 @@ var (
)
func main() {
flag.StringVar(&dsn, "dsn", "uptimemonitor.sqlite?_journal_mode=WAL&_busy_timeout=5000&_synchronous=FULL&_txlock=immediate", "database server name")
flag.StringVar(&dsn, "dsn", "data/uptimemonitor.sqlite?_journal_mode=WAL&_busy_timeout=5000&_synchronous=FULL&_txlock=immediate", "database server name")
flag.StringVar(&addr, "addr", ":3000", "server address")
flag.BoolVar(&secure, "secure", true, "use https")
flag.Parse()
if os.Getenv("SECURE") == "false" {
secure = false
}
store := store.New(dsn)
service := service.New(store)
handler := handler.New(store, service, secure)

2
data/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

17
docker-compose.yml Normal file
View File

@@ -0,0 +1,17 @@
# documentation: https://github.com/airlabspl/uptimemonitor/blob/master/README.md
# slogan: A self-hosted, simple web uptime monitor
# tags: uptime,downtime,monitor,self-hosted
# logo: svgs/uptime-monitor-dev.svg
# port: 3000
services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
- SECURE=false
ports:
- "3000:3000"
restart: always
volumes:
- ${COOLIFY_VOLUME_APP}:/app/data