mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 20:52:14 +01:00
now generating Dockerfiles from blueprint
This commit is contained in:
52
_blueprints/Dockerfile.blueprint
Normal file
52
_blueprints/Dockerfile.blueprint
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
FROM {{ if eq "TESTS" .Orbit.Image }}golang:1.10-stretch{{ else }}debian:stretch-slim{{ end }}
|
||||||
|
|
||||||
|
LABEL authors="Julien Neuhart <j.neuhart@thecodingmachine.com>"
|
||||||
|
|
||||||
|
# |--------------------------------------------------------------------------
|
||||||
|
# | Libraries
|
||||||
|
# |--------------------------------------------------------------------------
|
||||||
|
# |
|
||||||
|
# | Installs all required libraries.
|
||||||
|
# |
|
||||||
|
|
||||||
|
RUN echo "deb http://httpredir.debian.org/debian/ stretch main contrib non-free" > /etc/apt/sources.list &&\
|
||||||
|
apt-get update &&\
|
||||||
|
apt-get install -y xvfb wkhtmltopdf pdftk unoconv ttf-mscorefonts-installer &&\
|
||||||
|
ln -s /usr/bin/xvfb-run /usr/local/bin/xvfb-run &&\
|
||||||
|
ln -s /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf &&\
|
||||||
|
ln -s /usr/bin/pdftk /usr/local/bin/pdftk &&\
|
||||||
|
ln -s /usr/bin/unoconv /usr/local/bin/unoconv
|
||||||
|
|
||||||
|
# |--------------------------------------------------------------------------
|
||||||
|
# | Gotenberg
|
||||||
|
# |--------------------------------------------------------------------------
|
||||||
|
# |
|
||||||
|
# | All Gotenberg related stuff.
|
||||||
|
# |
|
||||||
|
|
||||||
|
{{- if eq "TESTS" .Orbit.Image }}
|
||||||
|
|
||||||
|
WORKDIR /go/src/github.com/thecodingmachine/gotenberg
|
||||||
|
|
||||||
|
# Installs lint dependencies.
|
||||||
|
RUN go get -u gopkg.in/alecthomas/gometalinter.v2 &&\
|
||||||
|
gometalinter.v2 --install
|
||||||
|
|
||||||
|
# Copies our Go source.
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Installs project dependencies.
|
||||||
|
RUN go get -d -v ./...
|
||||||
|
|
||||||
|
ENTRYPOINT ["_ci/docker-entrypoint.sh"]
|
||||||
|
{{- else }}
|
||||||
|
|
||||||
|
COPY gotenberg /usr/bin/gotenberg
|
||||||
|
RUN ln -s /usr/bin/gotenberg /usr/local/bin/gotenberg
|
||||||
|
|
||||||
|
WORKDIR /gotenberg
|
||||||
|
COPY gotenberg.yml /gotenberg/gotenberg.yml
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["gotenberg"]
|
||||||
|
{{- end }}
|
||||||
@@ -9,6 +9,8 @@ tasks:
|
|||||||
short: Generates all files from blueprints
|
short: Generates all files from blueprints
|
||||||
run:
|
run:
|
||||||
- BRANCH="$(git symbolic-ref --short HEAD)"; orbit generate -f _blueprints/README.blueprint.md -o README.md -p "Branch,${BRANCH}"
|
- BRANCH="$(git symbolic-ref --short HEAD)"; orbit generate -f _blueprints/README.blueprint.md -o README.md -p "Branch,${BRANCH}"
|
||||||
|
- orbit generate -f _blueprints/Dockerfile.blueprint -o Dockerfile.tests -p "Image,TESTS"
|
||||||
|
- orbit generate -f _blueprints/Dockerfile.blueprint -o Dockerfile -p "Image,BUILD"
|
||||||
|
|
||||||
- use: tests
|
- use: tests
|
||||||
short: Runs tests inside a container
|
short: Runs tests inside a container
|
||||||
|
|||||||
Reference in New Issue
Block a user