Skip to content

Commit

Permalink
Adds docker base image build
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Aug 7, 2023
0 parents commit 1cb0a32
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

patreon: butschster
42 changes: 42 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker Image CI

on:
release:
types:
- created

jobs:
build-release:
if: "!github.event.release.prerelease"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: v0.1

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_LOGIN }}
password: ${{ secrets.GHCR_PASSWORD }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: ./
platforms: linux/amd64,linux/arm64
file: ./docker/Dockerfile
push: true
tags:
ghcr.io/${{ github.repository }}:latest, ghcr.io/${{ github.repository }}:${{ steps.previoustag.outputs.tag }}
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/docker.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM php:8.1.3-cli-alpine3.15

RUN apk add --no-cache \
curl \
libcurl \
wget \
libzip-dev \
libmcrypt-dev \
libxslt-dev \
libxml2-dev \
icu-dev \
zip

RUN docker-php-ext-install \
opcache \
zip \
xsl \
dom \
exif \
intl \
pcntl \
bcmath \
sockets

RUN apk add --no-cache nginx
RUN cp docker/nginx/nginx.conf /etc/nginx/nginx.conf
RUN [ -d /etc/nginx/conf.d ] || mkdir /etc/nginx/conf.d
RUN cp docker/nginx/default.conf /etc/nginx/conf.d/default.conf

RUN curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer

RUN docker-php-source delete \
&& apk del ${BUILD_DEPENDS}
22 changes: 22 additions & 0 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

server {
listen 8000;

server_name _;

location /connection {
proxy_pass http://127.0.0.1:8089/connection;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}

location / {
proxy_pass http://127.0.0.1:8082;
}
}
30 changes: 30 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
daemon off;
user nginx;
worker_processes 1;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /dev/stdout main;

# fix for very long server names
server_names_hash_bucket_size 128;

sendfile on;
# tcp_nopush on;

keepalive_timeout 65;

# gzip on;

include /etc/nginx/conf.d/*.conf;
}

0 comments on commit 1cb0a32

Please sign in to comment.