Compare commits

...

3 Commits

Author SHA1 Message Date
hgw
e3e75e7b0b
Add Docker information to README 2023-10-04 01:32:49 +00:00
hgw
37ac0f9e50
Add Docker support 2023-10-04 01:29:26 +00:00
hgw
e4f255c074
Add .gitignore 2023-10-04 01:25:10 +00:00
5 changed files with 36 additions and 2 deletions

5
.dockerignore Normal file
View File

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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
files/

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"]

View File

@ -17,9 +17,12 @@ HardFiles is built on the principle of flexibility. If you choose to run your ow
## Deployment Guide for HardFiles ## Deployment Guide for HardFiles
#### 1. Configuration: #### 1. Configuration:
Start by adjusting the necessary configuration variables in `main.go`. Start by adjusting the necessary configuration variables in `config.toml`.
#### 2. Build and Run
##### Bare Metal:
#### 2. Build and Run:
Execute the following commands to build and initiate HardFiles: Execute the following commands to build and initiate HardFiles:
``` ```
go build -o hardfiles main.go go build -o hardfiles main.go
@ -27,6 +30,13 @@ mkdir files
./hardfiles ./hardfiles
``` ```
##### Docker Compose:
Execute the following commands to build and initiate HardFiles in Docker:
```
docker compose up -d --build
```
#### 3. Default Port: #### 3. Default Port:
By default, HardFiles listens on port `5000`. For production environments, it's recommended to use a robust web server like Nginx or Apache to proxy traffic to this port. By default, HardFiles listens on port `5000`. For production environments, it's recommended to use a robust web server like Nginx or Apache to proxy traffic to this port.

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"