-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from JustKato/docker
Dockerized!
- Loading branch information
Showing
5 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ dev/* | |
!dev/.keep | ||
.env | ||
docker-compose.yaml | ||
data | ||
data | ||
dist/* | ||
!dist/.keep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |