Add Docker support

This commit is contained in:
hgw 2023-10-04 01:29:26 +00:00
parent e4f255c074
commit 37ac0f9e50
Signed by: hgw
SSH Key Fingerprint: SHA256:diG7RVYHjd3aDYkZWHYcBJbImu+6zfptuUP+3k/wol4
3 changed files with 23 additions and 0 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
Dockerfile
docker-compose.yml
.gitignore
README.md
config.toml

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM golang:1.21-alpine
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
RUN go build -o hardfiles main.go
RUN mkdir files
CMD ["./hardfiles"]

10
docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
services:
hardfiles:
container_name: hardfiles
build: .
volumes:
- "$PWD/files:/app/files"
- "$PWD/www:/app/www"
- "$PWD/config.toml:/app/config.toml"
ports:
- "5000:5000"