-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: docker updates, instance list (merge pull request #21 from code…
…dipper/docker-attempt2) Better Docker, Edit instance list
- Loading branch information
Showing
7 changed files
with
48 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.github/ | ||
.git/ | ||
.gitignore | ||
.dockerignore | ||
docker-compose.yml | ||
Dockerfile | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,17 @@ | ||
FROM alpine:3.18 | ||
|
||
WORKDIR "/var/www/html" | ||
|
||
ADD "." "." | ||
|
||
# Docker metadata contains information about the maintainer, such as the name, repository, and support email | ||
# See more: https://docs.docker.com/config/labels-custom-metadata/ | ||
LABEL name="Binternet" \ | ||
description="A custom Pinterest frontend, made in PHP." \ | ||
version="1.0" \ | ||
vendor="Ahwx <ahwx.org>" \ | ||
maintainer="Ahwx <ahwx.org>" \ | ||
url="https://github.com/Ahwxorg/LibreY" \ | ||
authors="https://github.com/Ahwxorg/LibreY/contributors" | ||
|
||
# Include arguments as temporary environment variables to be handled by Docker during the image build process | ||
# Change or add new arguments to customize the image generated by 'docker build' command | ||
ARG DOCKER_SCRIPTS="docker" | ||
ARG NGINX_PORT=8009 | ||
# Set this argument during build time to indicate that the path is for php's www.conf | ||
ARG WWW_CONFIG="/etc/php82/php-fpm.d/www.conf" | ||
|
||
# Customize the environment during both execution and build time by modifying the environment variables added to the container's shell | ||
# When building your image, make sure to set the 'TZ' environment variable to your desired time zone location, for example 'America/Sao_Paulo' | ||
# See more: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List | ||
ENV TZ="Europe/Amsterdam" | ||
|
||
# Install required packages | ||
RUN apk add gettext php82 php82-fpm php82-dom php82-curl php82-json nginx --no-cache | ||
|
||
# Configure PHP-FPM to listen on a Unix socket instead of a TCP port, which is more secure and efficient | ||
RUN touch /run/php-fpm82.sock && chown nginx:nginx "/run/php-fpm82.sock" | ||
RUN sed -i 's/^\s*listen = 127.0.0.1:9000/listen = \/run\/php-fpm82.sock/' ${WWW_CONFIG} &&\ | ||
sed -i 's/^\s*;\s*listen.owner = nobody/listen.owner = nginx/' ${WWW_CONFIG} &&\ | ||
sed -i 's/^\s*;\s*listen.group = nobody/listen.group = nginx/' ${WWW_CONFIG} &&\ | ||
sed -i 's/^\s*;\s*listen.mode = 0660/listen.mode = 0660/' ${WWW_CONFIG} | ||
|
||
EXPOSE ${NGINX_PORT} | ||
|
||
# Configures the container to be run as an executable. | ||
ENTRYPOINT ["/bin/sh", "-c", "docker/entrypoint.sh"] | ||
FROM nginx:mainline-alpine-slim | ||
|
||
RUN apk add php82 php82-fpm php82-dom php82-curl php82-json php82-openssl --no-cache | ||
RUN sed -i 's/user nginx;/user nobody;/' /etc/nginx/nginx.conf \ | ||
&& sed -i 's/listen = 127.0.0.1:9000/listen = \/run\/php-fpm82.sock/' /etc/php82/php-fpm.d/www.conf \ | ||
&& sed -i 's/;listen.owner/listen.owner/' /etc/php82/php-fpm.d/www.conf \ | ||
&& sed -i 's/;listen.group/listen.group/' /etc/php82/php-fpm.d/www.conf \ | ||
&& sed -i 's/;listen.mode/listen.mode/' /etc/php82/php-fpm.d/www.conf \ | ||
&& sed -i 's/;listen.allowed_clients/listen.allowed_clients/' /etc/php82/php-fpm.d/www.conf | ||
|
||
RUN mkdir -p /var/www/binternet | ||
COPY . /var/www/binternet | ||
COPY nginx.conf /etc/nginx/conf.d/binternet.conf | ||
RUN rm /var/www/binternet/nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
EXPOSE 80 | ||
ENTRYPOINT ["/bin/sh", "-c" , "/usr/sbin/php-fpm82 -D && /usr/sbin/nginx -c /etc/nginx/nginx.conf -g 'daemon off;'"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: '3.3' | ||
services: | ||
binternet: | ||
container_name: binternet | ||
image: ghcr.io/ahwxorg/binternet:latest | ||
ports: | ||
- '8080:80' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
server { | ||
listen 8009; | ||
listen 80 default_server; | ||
server_name _; | ||
|
||
root /var/www/html/binternet; | ||
index index.php; | ||
root /var/www/binternet; | ||
index index.php; | ||
|
||
location ~ \.php$ { | ||
include snippets/fastcgi-php.conf; | ||
fastcgi_pass unix:/run/php/php7.4-fpm.sock; | ||
} | ||
location ~ \.php$ { | ||
fastcgi_pass unix:/run/php-fpm82.sock; | ||
fastcgi_index index.php; | ||
fastcgi_param PATH_INFO $path_info; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
|
||
fastcgi_split_path_info ^(.+?\.php)(/.*)$; | ||
try_files $fastcgi_script_name =404; | ||
set $path_info $fastcgi_path_info; | ||
|
||
include fastcgi_params; | ||
} | ||
} |