Skip to content

Commit e2c51c5

Browse files
authored
Merge pull request #3 from pdsinterop/cleanup/ci
Build and Push docker image
2 parents 55d4472 + baa4312 commit e2c51c5

File tree

3 files changed

+50
-13
lines changed

3 files changed

+50
-13
lines changed

.dockerignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
Dockerfile
2-
run-solid-test-suite.sh
1+
# Directories to ignore
32
.git
3+
4+
# Files to ignore
5+
.gitignore
6+
_config.yml
7+
CHANGELOG.md
8+
CODE_OF_CONDUCT.md
9+
CONTRIBUTING.md
10+
Dockerfile
11+
Gemfile

.github/workflows/docker.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
docker-build-pub-sub:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- uses: docker/login-action@v2
18+
with:
19+
registry: ghcr.io
20+
username: ${{ github.actor }}
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Build Pub-Sub Docker image
24+
run: |
25+
docker build -t "ghcr.io/pdsinterop/php-solid-pubsub-server:latest" .
26+
docker push "ghcr.io/pdsinterop/php-solid-pubsub-server:latest"

Dockerfile

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
FROM php:7.2
2-
RUN apt-get update && \
3-
apt-get install -y \
2+
3+
RUN apt-get update \
4+
&& apt-get install -yq --no-install-recommends \
45
git \
5-
zlib1g-dev
6-
WORKDIR /tls
7-
WORKDIR /install
8-
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
9-
RUN php composer-setup.php
10-
RUN php -r "unlink('composer-setup.php');"
11-
ADD . /app
6+
zip \
7+
zlib1g-dev \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
COPY . /app
11+
12+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
13+
RUN composer install --working-dir=/app --no-dev --prefer-dist \
14+
&& rm /usr/local/bin/composer
15+
1216
WORKDIR /app
13-
RUN php /install/composer.phar install --no-dev --prefer-dist
1417
EXPOSE 8080
15-
CMD php server/server.php
18+
CMD ["php", "server/server.php"]

0 commit comments

Comments
 (0)