mirror of https://github.com/JustKato/FreePad.git
parent
b3220abdad
commit
b74836e779
|
@ -2,4 +2,6 @@ dev/*
|
||||||
!dev/.keep
|
!dev/.keep
|
||||||
.env
|
.env
|
||||||
docker-compose.yaml
|
docker-compose.yaml
|
||||||
data
|
data
|
||||||
|
dist/*
|
||||||
|
!dist/.keep
|
|
@ -0,0 +1,15 @@
|
||||||
|
FROM alpine
|
||||||
|
|
||||||
|
LABEL version="1.0.0"
|
||||||
|
|
||||||
|
# Copy the distribution files
|
||||||
|
COPY ./dist /app
|
||||||
|
|
||||||
|
# Make /app the work directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Expose the listening port
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# Run the program
|
||||||
|
ENTRYPOINT ["./freepad"]
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/sh
|
||||||
|
echo "Building FreePad...\n";
|
||||||
|
|
||||||
|
echo "Removing old build file...";
|
||||||
|
rm dist/freepad 2> /dev/null || true
|
||||||
|
rm -r dist/static 2> /dev/null || true
|
||||||
|
rm -r dist/templates 2> /dev/null || true
|
||||||
|
rm dist/.env 2> /dev/null || true
|
||||||
|
|
||||||
|
# Build
|
||||||
|
echo "Building executable"
|
||||||
|
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o ./dist/freepad .
|
||||||
|
|
||||||
|
echo "Copying templates"
|
||||||
|
cp -r ./templates ./dist/templates
|
||||||
|
cp -r ./static ./dist/static
|
||||||
|
|
||||||
|
echo "Building Done";
|
|
@ -0,0 +1,28 @@
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
freepad:
|
||||||
|
# Uncomment the bellow to use the production docker image from the docker repository
|
||||||
|
# image:
|
||||||
|
# Comment the build line if you are just looking to use a docker-compose file
|
||||||
|
build: .
|
||||||
|
# I don't recommend changing the 8080 as there would be no reason to,
|
||||||
|
# simply change the 3113 port to anything you would like for the container to listen on
|
||||||
|
ports:
|
||||||
|
- 3113:8080
|
||||||
|
# This will read from your .env variables, in that file you will find the documentation as well
|
||||||
|
environment:
|
||||||
|
- DOMAIN_BASE
|
||||||
|
- CACHE_MAP_LIMIT
|
||||||
|
- PAD_STORAGE_PATH
|
||||||
|
- API_BAN_LIMIT
|
||||||
|
- DEV_MODE
|
||||||
|
- CLEANUP_MAX_AGE
|
||||||
|
- MAXIMUM_PAD_SIZE
|
||||||
|
- 'GIN_MODE=release'
|
||||||
|
# This is the default data storage directory,
|
||||||
|
# you can mount this to ram, another server,
|
||||||
|
# locally, anything really it's just going to
|
||||||
|
# write plain files into it.
|
||||||
|
volumes:
|
||||||
|
- ./data:/app/data
|
Loading…
Reference in New Issue