0.9.3.1: Update Dockerfile and add compose file
All checks were successful
File-uploader-crystal CI / build (push) Successful in 1m49s
All checks were successful
File-uploader-crystal CI / build (push) Successful in 1m49s
This commit is contained in:
parent
0002c81429
commit
9de4960932
4 changed files with 17 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
# Based on https://github.com/iv-org/invidious/blob/master/docker/Dockerfile
|
# Based on https://github.com/iv-org/invidious/blob/master/docker/Dockerfile
|
||||||
FROM crystallang/crystal:1.13.2-alpine AS builder
|
FROM crystallang/crystal:1.14.0-alpine AS builder
|
||||||
|
|
||||||
RUN apk add --no-cache sqlite-static yaml-static
|
RUN apk add --no-cache sqlite-static yaml-static
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ RUN crystal build ./src/file-uploader-crystal.cr \
|
||||||
--release \
|
--release \
|
||||||
--static --warnings all
|
--static --warnings all
|
||||||
|
|
||||||
RUN apk add --no-cache tini
|
FROM alpine:3.20
|
||||||
FROM alpine:3.18
|
RUN apk add --no-cache tini ffmpeg
|
||||||
WORKDIR /file-uploader-crystal
|
WORKDIR /file-uploader-crystal
|
||||||
RUN addgroup -g 1000 -S file-uploader-crystal && \
|
RUN addgroup -g 1000 -S file-uploader-crystal && \
|
||||||
adduser -u 1000 -S file-uploader-crystal -G file-uploader-crystal
|
adduser -u 1000 -S file-uploader-crystal -G file-uploader-crystal
|
||||||
|
|
|
@ -3,7 +3,6 @@ files: "./files"
|
||||||
thumbnails: "./thumbnails"
|
thumbnails: "./thumbnails"
|
||||||
generateThumbnails: true
|
generateThumbnails: true
|
||||||
db: "./db.sqlite3"
|
db: "./db.sqlite3"
|
||||||
dbTableName: "files"
|
|
||||||
adminEnabled: true
|
adminEnabled: true
|
||||||
adminApiKey: "asd"
|
adminApiKey: "asd"
|
||||||
fileameLength: 3
|
fileameLength: 3
|
||||||
|
@ -18,13 +17,12 @@ torExitNodesFile: "./torexitnodes.txt"
|
||||||
torMessage: "TOR IS BLOCKED!"
|
torMessage: "TOR IS BLOCKED!"
|
||||||
# Set this to 0 to disable rate limiting
|
# Set this to 0 to disable rate limiting
|
||||||
filesPerIP: 2
|
filesPerIP: 2
|
||||||
ipTableName: "ips"
|
|
||||||
rateLimitPeriod: 20
|
rateLimitPeriod: 20
|
||||||
rateLimitMessage: ""
|
rateLimitMessage: ""
|
||||||
# If you define the unix socket, it will only listen on the socket and not the port.
|
# If you define the unix socket, it will only listen on the socket and not the port.
|
||||||
#unix_socket: "/tmp/file-uploader.sock"
|
#unix_socket: "/tmp/file-uploader.sock"
|
||||||
# In days
|
# In days
|
||||||
deleteFilesAfter: 1
|
deleteFilesAfter: 7
|
||||||
# In seconds
|
# In seconds
|
||||||
deleteFilesCheck: 1600
|
deleteFilesCheck: 1600
|
||||||
deleteKeyLength: 4
|
deleteKeyLength: 4
|
||||||
|
|
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
services:
|
||||||
|
file-uploader:
|
||||||
|
image: git.nadeko.net/fijxu/file-uploader-crystal:latest
|
||||||
|
# If you want to use a custom config file, you can mount it here.
|
||||||
|
volumes:
|
||||||
|
# - ./config/config.yml:/file-uploader-crystal/config/config.yml
|
||||||
|
- ./files:/file-uploader-crystal/files
|
||||||
|
- ./thumbnails:/file-uploader-crystal/thumbnails
|
||||||
|
- ./db.sqlite3:/file-uploader-crystal/db.sqlite3
|
||||||
|
- ./torexitnodes.txt:/file-uploader-crystal/torexitnodes.txt
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:8080:8080
|
|
@ -222,7 +222,7 @@ module Utils
|
||||||
begin
|
begin
|
||||||
File.open(CONFIG.torExitNodesFile, "w") { |output| IO.copy(res.body_io, output) }
|
File.open(CONFIG.torExitNodesFile, "w") { |output| IO.copy(res.body_io, output) }
|
||||||
rescue ex
|
rescue ex
|
||||||
LOGGER.error "Failed to write to file: #{ex.message}"
|
LOGGER.error "Failed to save exit nodes list: #{ex.message}"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
LOGGER.error "Failed to retrieve exit nodes list. Status Code: #{res.status_code}"
|
LOGGER.error "Failed to retrieve exit nodes list. Status Code: #{res.status_code}"
|
||||||
|
|
Loading…
Reference in a new issue