Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Joakim Saario
aurweb
Commits
33ff452b
Verified
Commit
33ff452b
authored
Jun 09, 2021
by
Joakim Saario
Browse files
Docker setup: Use php-fpm
parent
f6df5427
Pipeline
#8258
passed with stage
in 4 minutes and 5 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
33ff452b
FROM
archlinux
FROM
archlinux
:base-devel
# Install dependencies. Note that they are split up in multiple layers to speed
# up the build process when rebuilding the image. Dependencies are grouped
...
...
@@ -12,17 +12,19 @@ RUN pacman -Syu --noconfirm nginx
RUN
pacman
-Syu
--noconfirm
mariadb mariadb-clients
# Install PHP dependencies
RUN
pacman
-Syu
--noconfirm
php
RUN
sed
-ri
's/^;?(extension=pdo_mysql)/\1/'
/etc/php/php.ini
RUN
pacman
-Syu
--noconfirm
php php-fpm
# Install cgit dependencies
RUN
pacman
-Syu
--noconfirm
openssh git cgit uwsgi uwsgi-plugin-cgi
# Install dependencies.
RUN
pacman
-Syu
--noconfirm
base-devel git
gpgme protobuf pyalpm
\
python-mysqlclient
python-pygit2 python-srcinfo python-bleach python-markdown
\
RUN
pacman
-Syu
--noconfirm
gpgme protobuf pyalpm
python-mysqlclient
\
python-pygit2 python-srcinfo python-bleach python-markdown
\
python-sqlalchemy python-alembic python-pytest python-werkzeug
\
python-pytest-tap python-fastapi nginx python-authlib python-itsdangerous
\
python-httpx python-jinja python-pytest-cov python-requests python-aiofiles
\
python-python-multipart python-pytest-asyncio python-coverage hypercorn
\
python-bcrypt python-email-validator
openssh
python-lxml
python-bcrypt python-email-validator python-lxml
# Copy various docker-related configs and scripts
COPY
docker /
...
...
@@ -32,7 +34,7 @@ COPY . .
ENV
AUR_CONFIG /aurweb/conf/config
# Setup
o
ur
test
config
.
# Setup
a
ur
web
config
RUN
sed
-r
's;YOUR_AUR_ROOT;/aurweb;g'
conf/config.dev |
\
sed
-r
'/sqlite/d'
|
\
sed
-r
'/socket/d'
|
\
...
...
@@ -42,5 +44,8 @@ RUN sed -r 's;YOUR_AUR_ROOT;/aurweb;g' conf/config.dev | \
sed
-r
's/^;?(user).*/\1 = aur/'
|
\
sed
-r
's/^;?(password).*/\1 = aur/'
>
"
${
AUR_CONFIG
}
"
# Install translations
.
# Install translations
RUN
make
-C
po all
install
# Other configs
RUN
sed
-ri
's/^;?(extension=pdo_mysql)/\1/'
/etc/php/php.ini
docker-compose.yml
View file @
33ff452b
...
...
@@ -6,7 +6,7 @@ services:
image
:
aurweb:latest
init
:
true
entrypoint
:
/fastapi-entrypoint.sh
command
:
python -u -m hypercorn -b 0.0.0.0:800
0
aurweb.asgi:app
command
:
python -u -m hypercorn -b 0.0.0.0:800
1
aurweb.asgi:app
volumes
:
-
./aurweb:/aurweb/aurweb
-
./migrations:/aurweb/migrations
...
...
@@ -16,17 +16,17 @@ services:
-
./templates:/aurweb/templates
-
./Makefile:/aurweb/Makefile
ports
:
-
800
0
:800
0
-
800
1
:800
1
aurweb-php
:
image
:
aurweb:latest
init
:
true
entrypoint
:
/php-entrypoint.sh
command
:
php
-S 0.0.0.0:8001 -t /aurweb/web/html
command
:
php
-fpm --fpm-config /etc/php/php-fpm.conf --nodaemonize
volumes
:
-
./web:/aurweb/web
ports
:
-
8001:8001
-
"
9000"
nginx
:
image
:
aurweb:latest
...
...
@@ -35,12 +35,13 @@ services:
command
:
nginx
volumes
:
-
./docker/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
-
./web:/aurweb/web
ports
:
#
FastAPI
#
PHP
-
8080:8080
-
8443:8443
# TLS
#
PHP
#
FastAPI
-
8081:8081
-
8444:8444
# TLS
...
...
docker/etc/nginx/nginx.conf
View file @
33ff452b
...
...
@@ -12,6 +12,8 @@ http {
ssl_certificate
/etc/nginx/ssl/cert.crt
;
ssl_certificate_key
/etc/nginx/ssl/cert.key
;
include
mime.types
;
server
{
listen
8080
;
...
...
@@ -27,8 +29,20 @@ http {
server
{
listen
8443
ssl
;
location
/
{
proxy_pass
http://aurweb-fastapi:8000
;
root
/aurweb/web/html
;
index
index.php
;
location
~
^/[^/]+\.php($|/)
{
fastcgi_pass
aurweb-php
:
9000
;
fastcgi_index
index.php
;
fastcgi_split_path_info
^(/[^/]+
\
.php)(/.*)
$
;
fastcgi_param
SCRIPT_FILENAME
$document_root$fastcgi_script_name
;
fastcgi_param
PATH_INFO
$fastcgi_path_info
;
include
fastcgi_params
;
}
location
~
.*
{
rewrite
^/(.*)
$
/index.php/
$1
last
;
}
}
...
...
@@ -36,7 +50,7 @@ http {
listen
8444
ssl
;
location
/
{
proxy_pass
http://aurweb-
php
:8001
;
proxy_pass
http://aurweb-
fastapi
:8001
;
}
}
}
docker/fastapi-entrypoint.sh
View file @
33ff452b
...
...
@@ -2,6 +2,6 @@
set
-euo
pipefail
sed
-ri
's;^(aur_location).*;\1 = https://127.0.0.1:844
3
;'
/aurweb/conf/config
sed
-ri
's;^(aur_location).*;\1 = https://127.0.0.1:844
4
;'
/aurweb/conf/config
exec
"
$@
"
docker/php-entrypoint.sh
View file @
33ff452b
...
...
@@ -2,6 +2,9 @@
set
-euo
pipefail
sed
-ri
's;^(aur_location).*;\1 = https://127.0.0.1:8444;'
/aurweb/conf/config
sed
-ri
's;^(aur_location).*;\1 = https://127.0.0.1:8443;'
/aurweb/conf/config
sed
-ri
's/(listen).*/\1 = 0.0.0.0:9000/'
/etc/php/php-fpm.d/www.conf
sed
-ri
's/;?(clear_env).*/\1 = no/'
/etc/php/php-fpm.d/www.conf
exec
"
$@
"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment