huge refactoring

This commit is contained in:
Julien Neuhart
2019-07-23 13:57:18 +02:00
parent f6b357691c
commit 7bfbda4490
105 changed files with 4051 additions and 2667 deletions

View File

@@ -1,5 +1,3 @@
ARG GOLANG_VERSION
# |--------------------------------------------------------------------------
# | Binary
# |--------------------------------------------------------------------------
@@ -7,7 +5,7 @@ ARG GOLANG_VERSION
# | Buils Gotenberg binary.
# |
FROM golang:${GOLANG_VERSION}-stretch AS golang
FROM thecodingmachine/gotenberg:workspace AS workspace
ARG VERSION
@@ -16,7 +14,7 @@ ENV GOOS=linux \
CGO_ENABLED=0
# Define our workding outside of $GOPATH (we're using go modules).
WORKDIR /gotenberg
WORKDIR /gotenberg/package
# Copy our source code.
COPY internal ./internal
@@ -25,7 +23,7 @@ COPY go.sum go.sum
COPY go.mod go.mod
# Build our binary.
RUN go build -o /gotenberg/gotenberg -ldflags "-X main.version=${VERSION}" cmd/gotenberg/main.go
RUN go build -o gotenberg -ldflags "-X main.version=${VERSION}" cmd/gotenberg/main.go
# |--------------------------------------------------------------------------
# | Final touch
@@ -38,9 +36,8 @@ FROM thecodingmachine/gotenberg:base
LABEL authors="Julien Neuhart <j.neuhart@thecodingmachine.com>"
COPY --from=golang /gotenberg/gotenberg /usr/local/bin/
COPY --from=workspace /gotenberg/package/gotenberg /usr/local/bin/
ENV PM2_HOME=/gotenberg/.pm2
USER gotenberg
WORKDIR /gotenberg