Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
steps:
- uses: actions/checkout@v3

# TODO build project

- uses: docker/setup-buildx-action@v2

- name: Build docker image
Expand Down
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM php:8.1-fpm

WORKDIR /var/www

RUN apt update -y && apt install -y nginx

COPY src .
COPY /docker/nginx/default /etc/nginx/sites-available/default

COPY entrypoint entrypoint
RUN chmod +x ./entrypoint
ENTRYPOINT ["./entrypoint"]

EXPOSE 8080
63 changes: 63 additions & 0 deletions docker/nginx/default
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
listen 8080 default_server;
listen [::]:8080 default_server;

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

root /var/www;

# Add index.php to the list if you are using PHP
index index.php;

server_name _;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

# pass PHP scripts to FastCGI server
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass 127.0.0.1:9000;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}
4 changes: 4 additions & 0 deletions entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

service nginx restart
php-fpm
3 changes: 3 additions & 0 deletions src/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

echo 'Hello, ' . getenv('GREETING_NAME');