adding first files and infra

This commit is contained in:
Janis Steiner
2024-12-13 14:42:52 +01:00
parent e2e227f607
commit 010896e39a
4 changed files with 2057 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<VirtualHost *:80>
ServerName auth.jakach.srv
DocumentRoot /var/www/html
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
ServerName auth.jakach.srv
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateKeyFile /etc/apache2/certs/privkey.pem
SSLCertificateFile /etc/apache2/certs/fullchain.pem
# SSLCertificateChainFile /etc/apache2/certs/fullchain.pem
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

43
docker-compose.yml Normal file
View File

@@ -0,0 +1,43 @@
version: '3.3'
services:
app-db:
image: yobasystems/alpine-mariadb:latest
container_name: app-db
environment:
MYSQL_ROOT_PASSWORD: 1234
networks:
app-network:
ipv4_address: 192.168.178.2
volumes:
- app-db-storage:/var/lib/mysql
app-srv:
build:
context: .
dockerfile: srv_dockerfile
container_name: app-srv
networks:
app-network:
ipv4_address: 192.168.178.3
ports:
- "80:80"
- "443:443"
depends_on:
- app-db
volumes:
- ./app-code:/var/www/html
- ./apache-conf:/etc/apache2/sites-available
- ./php-conf:/usr/local/etc/php/
- ./certs:/etc/apache2/certs
networks:
app-network:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.178.0/24
volumes:
app-db-storage:
external: true

1950
php-conf/php.ini Normal file

File diff suppressed because it is too large Load Diff

34
srv_dockerfile Normal file
View File

@@ -0,0 +1,34 @@
FROM php:apache
# Install necessary PHP extensions and tools
RUN apt-get update && \
apt-get install -y libzip-dev zip zlib1g-dev git unzip && \
docker-php-ext-install mysqli zip
# Enable SSL module for Apache
RUN a2enmod ssl
# Restart Apache to apply changes
RUN service apache2 restart
# Set working directory
WORKDIR /var/www/html
# Copy application code
COPY ./app-code /var/www/html
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Install WebAuthn library using Composer
RUN composer require web-auth/webauthn-lib
# Create necessary directories with appropriate permissions
RUN mkdir -p /var/www/html/install/ \
/var/www/html/database_srv \
/var/www/html/export \
/var/www/html/import && \
chown -R www-data:www-data /var/www/html/export/ \
/var/www/html/import/ \
/var/www/html/install/ \
/var/www/html/database_srv/