Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Dockerfile for container image building #254

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Temporary image to download the package
FROM maven:3.8 as builder

ADD . /build
WORKDIR /build

RUN apt-get update \
&& apt install -y python3 \
&& ln -s /usr/bin/python3 /usr/bin/python
RUN python3 tools/createCompletionLists.py && mvn verify \
&& VERSION=$(grep "<version>.*</version>" pom.xml | head -n1 | cut -d '>' -f 2 | cut -d '<' -f 1) \
&& cd target \
&& tar xvf ltex-ls-${VERSION}.tar.gz \
&& mv ltex-ls-${VERSION} /app \
&& rm /app/bin/*.bat \
&& find /app -maxdepth 1 -type f -not -name LICENSE.md -delete

# Actual image
FROM openjdk:slim

ENV PATH="${PATH}:/app/bin"
WORKDIR /app/bin
COPY --from=builder /app /app
CMD [ "echo", "Usage: 'ltex-ls [PARAMS]' or 'ltex-cli [PARAMS]'. A directory must be mounted to analyse files using ltex-cli." ]