Skip to content

Commit 5077b1a

Browse files
authored
Add Dockerfile (#185)
* Add Dockerfile * Add .dockerignore * Publish to docker hub on every release
1 parent 48e0167 commit 5077b1a

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.DS_Store
2+
.vscode/
3+
.idea/
4+
.git/
5+
tests/
6+
fixtures/
7+
coverage/
8+
coverage.xml
9+
images/

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ language: php
33
php:
44
- '7.0'
55

6+
services:
7+
- docker
8+
69
cache:
710
directories:
811
- vendor
@@ -16,3 +19,9 @@ script:
1619

1720
after_success:
1821
- bash <(curl -s https://codecov.io/bash)
22+
- |
23+
if [[ $TRAVIS_TAG == v* ]]; then
24+
docker build -t felixfbecker/php-language-server:${TRAVIS_TAG:1} .
25+
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
26+
docker push felixfbecker/php-language-server:${TRAVIS_TAG:1}
27+
fi

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
# Running this container will start a language server that listens for TCP connections on port 2088
3+
# Every connection will be run in a forked child process
4+
5+
# Please note that before building the image, you have to install dependencies with `composer install`
6+
7+
FROM php:7-cli
8+
MAINTAINER Felix Becker <felix.b@outlook.com>
9+
10+
RUN apt-get update \
11+
# Needed for CodeSniffer
12+
&& apt-get install -y libxml2 libxml2-dev \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
RUN docker-php-ext-configure pcntl --enable-pcntl
16+
RUN docker-php-ext-install pcntl
17+
COPY ./php.ini /usr/local/etc/php/conf.d/
18+
19+
COPY ./ /srv/phpls
20+
21+
WORKDIR /srv/phpls
22+
23+
EXPOSE 2088
24+
25+
CMD ["--tcp-server=0:2088"]
26+
27+
ENTRYPOINT ["php", "bin/php-language-server.php"]

php.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
# php.ini for Docker
3+
4+
error_reporting = E_ALL
5+
display_errors = stderr

0 commit comments

Comments
 (0)