nagyjából kész Docker-image
This commit is contained in:
commit
8c17294652
32
Dockerfile
Normal file
32
Dockerfile
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
|
# install necessary packages
|
||||||
|
RUN \
|
||||||
|
apt-get update && \
|
||||||
|
DEBIAN_FRONTEND="noninteractive" apt-get install apache2 php libapache2-mod-php php-mysql php-xdebug imagemagick -y
|
||||||
|
# rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# define volumes
|
||||||
|
VOLUME ["/var/www/html/ARTWORKS", "/var/log/apache"]
|
||||||
|
|
||||||
|
# copy startscript
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
# change workdir
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
# copy PhotoWall webapplication files
|
||||||
|
COPY ./wwwdata/*.php /var/www/html/
|
||||||
|
COPY ./wwwdata/js /var/www/html/js/
|
||||||
|
COPY ./wwwdata/*.css /var/www/html/
|
||||||
|
COPY ./wwwdata/media /var/www/html/media/
|
||||||
|
COPY ./php.ini /etc/php/7.4/apache2/
|
||||||
|
COPY ./config/apache2 /etc/apache2
|
||||||
|
|
||||||
|
# let through ports for webserver and xdebug access
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 9000
|
||||||
|
|
||||||
|
# define starting command
|
||||||
|
CMD ["sh", "/entrypoint.sh"]
|
||||||
|
|
31
config/apache2/sites-available/000-default.conf
Normal file
31
config/apache2/sites-available/000-default.conf
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<VirtualHost *:80>
|
||||||
|
# The ServerName directive sets the request scheme, hostname and port that
|
||||||
|
# the server uses to identify itself. This is used when creating
|
||||||
|
# redirection URLs. In the context of virtual hosts, the ServerName
|
||||||
|
# specifies what hostname must appear in the request's Host: header to
|
||||||
|
# match this virtual host. For the default virtual host (this file) this
|
||||||
|
# value is not decisive as it is used as a last resort host regardless.
|
||||||
|
# However, you must set it for any further virtual host explicitly.
|
||||||
|
ServerName
|
||||||
|
|
||||||
|
ServerAdmin webmaster@localhost
|
||||||
|
DocumentRoot /var/www/html
|
||||||
|
|
||||||
|
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
|
||||||
|
# error, crit, alert, emerg.
|
||||||
|
# It is also possible to configure the loglevel for particular
|
||||||
|
# modules, e.g.
|
||||||
|
#LogLevel info ssl:warn
|
||||||
|
|
||||||
|
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||||
|
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||||
|
|
||||||
|
# For most configuration files from conf-available/, which are
|
||||||
|
# enabled or disabled at a global level, it is possible to
|
||||||
|
# include a line for only one particular virtual host. For example the
|
||||||
|
# following line enables the CGI configuration for this host only
|
||||||
|
# after it has been globally disabled with "a2disconf".
|
||||||
|
#Include conf-available/serve-cgi-bin.conf
|
||||||
|
</VirtualHost>
|
||||||
|
|
||||||
|
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
19
docker-compose-example.yml
Normal file
19
docker-compose-example.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
version: '3.6'
|
||||||
|
services:
|
||||||
|
# levendula photowall
|
||||||
|
phw_levendula:
|
||||||
|
container_name: phw_levendula
|
||||||
|
image: phw
|
||||||
|
restart: always
|
||||||
|
depends_on:
|
||||||
|
- phw_mysql
|
||||||
|
ports:
|
||||||
|
- 8002:80
|
||||||
|
environment:
|
||||||
|
PHW_SQL_USER: photowall_user
|
||||||
|
PHW_SQL_PASS: photowpwd
|
||||||
|
PHW_SQL_DB: photowall_levendula_db
|
||||||
|
PHW_SQL_IP: 172.28.0.6
|
||||||
|
PHW_SERVER_NAME: www.epagris.com/mkk/levendula/photowall
|
||||||
|
volumes:
|
||||||
|
- ~/PHOTOWALL/ARTWORKS/levendula:/var/www/html/ARTWORKS
|
22
entrypoint.sh
Executable file
22
entrypoint.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# generate globals.php from environment variables
|
||||||
|
cd /var/www/html
|
||||||
|
|
||||||
|
echo "<?php define('SQL_USER', '${PHW_SQL_USER}'); define('SQL_PASS', '${PHW_SQL_PASS}'); define('SQL_DB', '${PHW_SQL_DB}'); define('SQL_IP', '${PHW_SQL_IP}');" > globals.php
|
||||||
|
|
||||||
|
# create ARTWORKS directories
|
||||||
|
mkdir -p ARTWORKS/incoming
|
||||||
|
mkdir -p ARTWORKS/thumbnails
|
||||||
|
mkdir -p ARTWORKS/published
|
||||||
|
|
||||||
|
# change owner to www-data
|
||||||
|
chown -R www-data:www-data ARTWORKS
|
||||||
|
|
||||||
|
# substitute server name
|
||||||
|
sed -i "s|ServerName|ServerName ${PHW_SERVER_NAME}|g" /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
|
|
||||||
|
# start webserver
|
||||||
|
/usr/sbin/apache2ctl -D FOREGROUND
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user