init
This commit is contained in:
13
App/docker/docker-compose.yaml
Normal file
13
App/docker/docker-compose.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
version: '3.7'
|
||||
services:
|
||||
app:
|
||||
build: ./php
|
||||
container_name: myapp
|
||||
ports:
|
||||
- 80:80
|
||||
networks:
|
||||
app_net:
|
||||
|
||||
networks:
|
||||
app_net:
|
||||
name: app_net
|
19
App/docker/php/Dockerfile
Normal file
19
App/docker/php/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
FROM php:7.4-apache-buster
|
||||
MAINTAINER vasyakrg <vasyakrg@gmail.com>
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
apt-transport-https \
|
||||
curl \
|
||||
wget \
|
||||
git \
|
||||
# && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
|
||||
&& apt-get update && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN rm /etc/apache2/sites-enabled/*
|
||||
COPY myapp.conf /etc/apache2/sites-available/myapp.conf
|
||||
RUN a2enmod rewrite headers && a2ensite myapp
|
||||
|
||||
COPY myapp/ /var/www/
|
||||
|
||||
WORKDIR /var/www
|
||||
# CMD ['apache2-foreground']
|
3
App/docker/php/build.sh
Executable file
3
App/docker/php/build.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker build -t vasyakrg/php-app . && docker push vasyakrg/php-app
|
17
App/docker/php/myapp.conf
Normal file
17
App/docker/php/myapp.conf
Normal file
@@ -0,0 +1,17 @@
|
||||
<VirtualHost *:80>
|
||||
ServerName localhost
|
||||
DocumentRoot /var/www
|
||||
<Directory "/var/www">
|
||||
DirectoryIndex index.html
|
||||
</Directory>
|
||||
|
||||
ErrorLog /var/log/apache2/error.log
|
||||
CustomLog /var/log/apache2/access.log combined
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}" !-f
|
||||
RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}" !-d
|
||||
RewriteRule "^" "/index.php" [L]
|
||||
|
||||
</VirtualHost>
|
8
App/docker/php/myapp/index.php
Normal file
8
App/docker/php/myapp/index.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Тестируем PHP</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php echo '<p>Привет, мир!</p>'; ?>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user