mirror of
https://github.com/JustKato/FreePad.git
synced 2026-03-20 02:59:46 +02:00
Compare commits
4 Commits
1.4.0
...
662dad90b7
| Author | SHA1 | Date | |
|---|---|---|---|
| 662dad90b7 | |||
| 1585d3b158 | |||
| 1d50efe3c6 | |||
| 0f5a352fc6 |
24
Dockerfile
24
Dockerfile
@@ -1,9 +1,27 @@
|
|||||||
FROM alpine
|
# Importing golang 1.18 to use as a builder for our source
|
||||||
|
FROM golang:1.18 as builder
|
||||||
|
|
||||||
|
# Use the /src directory as a workdir
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Copy the src to /src
|
||||||
|
COPY . ./
|
||||||
|
|
||||||
|
# Download dependencies
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
# Build the executable
|
||||||
|
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o freepad .
|
||||||
|
|
||||||
|
# Import alpine linux as a base
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
LABEL version="1.4.0"
|
LABEL version="1.4.0"
|
||||||
|
|
||||||
# Copy the distribution files
|
# Copy the files from the builder to the new image
|
||||||
COPY ./dist /app
|
COPY --from=builder /src/freepad /app/freepad
|
||||||
|
COPY --from=builder /src/templates /app/templates
|
||||||
|
COPY --from=builder /src/static /app/static
|
||||||
|
|
||||||
# Make /app the work directory
|
# Make /app the work directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
freepad:
|
freepad:
|
||||||
# Uncomment the bellow to use the production docker image from the docker repository
|
# Uncomment the bellow to use the production docker image from the docker repository
|
||||||
# image:
|
image: justkato/freepad
|
||||||
# Comment the build line if you are just looking to use a docker-compose file
|
# Comment the build line if you are just looking to use a docker-compose file
|
||||||
build: .
|
# build: .
|
||||||
# I don't recommend changing the 8080 as there would be no reason to,
|
# 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
|
# simply change the 3113 port to anything you would like for the container to listen on
|
||||||
ports:
|
ports:
|
||||||
- 3113:8080
|
- 8080:8080
|
||||||
# This will read from your .env variables, in that file you will find the documentation as well
|
# This will read from your .env variables, in that file you will find the documentation as well
|
||||||
environment:
|
environment:
|
||||||
- DOMAIN_BASE
|
- DOMAIN_BASE
|
||||||
|
|||||||
Reference in New Issue
Block a user