From 37ac0f9e50025fe890d1a46091b67f753f9141f3 Mon Sep 17 00:00:00 2001 From: hgw Date: Wed, 4 Oct 2023 01:29:26 +0000 Subject: [PATCH] Add Docker support --- .dockerignore | 5 +++++ Dockerfile | 8 ++++++++ docker-compose.yml | 10 ++++++++++ 3 files changed, 23 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f33467d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +Dockerfile +docker-compose.yml +.gitignore +README.md +config.toml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dcf08d8 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..eb795e4 --- /dev/null +++ b/docker-compose.yml @@ -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" \ No newline at end of file