Skip to content
Snippets Groups Projects
Commit 2d81aa0e authored by Janyk's avatar Janyk
Browse files

initial

parents
No related branches found
No related tags found
No related merge requests found
memory_limit = 1024M
\ No newline at end of file
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
sendfile on;
keepalive_timeout 65;
server {
listen 8888 default_server;
server_name _;
root /app/public;
index index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log /dev/stdout;
error_log /dev/stderr;
sendfile off;
client_max_body_size 100m;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffering off;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#include /etc/nginx/sites-enabled/*;
}
daemon off;
[opcache]
opcache.enable=1
opcache.revalidate_freq=0
opcache.validate_timestamps=0
opcache.max_accelerated_files=10000
opcache.memory_consumption=192
opcache.max_wasted_percentage=10
opcache.interned_strings_buffer=16
opcache.fast_shutdown=1
#!/bin/sh
echo "Starting PHP FPM in daemon mode"
php-fpm -D
# while ! nc -w 1 -z 127.0.0.1 9000; do sleep 0.1; done;
echo "Testing NGINX"
nginx -t
cat /etc/nginx/nginx.conf
echo "Starting NGINX"
nginx
name: Build container and push to registry on `latest` tag
on:
push:
branches:
- 'main'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/janyksteenbeek/web-docker:latest
\ No newline at end of file
FROM php:8.2-fpm-alpine
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN apk add --no-cache wget openssh-client git zip curl nginx
RUN mkdir -p /app
RUN mkdir -p /app/public
RUN echo '<html><head><meta name="robots" content="noindex"></head><body><h1>Woohoo! :)</h1><h3>It works!</h3></body>' > '/app/public/index.php'
COPY .deployment/nginx.conf /etc/nginx/nginx.conf
COPY .deployment/php-opcache.ini /usr/local/etc/php/conf.d/opcache.ini
COPY .deployment/docker-php-memlimit.ini /usr/local/etc/php/conf.d/docker-php-memlimit.ini
RUN apk add --no-cache bind-tools \
&& ssh-keyscan github.com > /etc/ssh/ssh_known_hosts \
&& dig -t a +short github.com | grep ^[0-9] | xargs -r -n1 ssh-keyscan >> /etc/ssh/ssh_known_hosts \
&& apk del bind-tools
RUN chmod +x /usr/local/bin/install-php-extensions && \
IPE_GD_WITHOUTAVIF=1 install-php-extensions pdo_mysql exif pcntl bcmath redis soap gd opcache
RUN chown -R www-data: /app
WORKDIR /app
EXPOSE 8888
CMD sh /app/.deployment/startup.sh
# Linux Web Container with nginx and PHP
This container containes a basic set up for a web application. It has been specifically designed for Laravel applications, but can be used for all kinds of web applications running on PHP.
## Packages
The following packages are present in this container, which has been based
on Alpine.
- nginx
- PHP 8.2
- PHP extensions: `pdo_mysql` `exif` `pcntl` `bcmath` `redis` `soap` `gd` `opcache`
- Additional packages: `wget` `openssh-client` `git` `zip` `curl`
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment