Skip to content

Add docker support #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 000-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www

<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM php:7-apache


RUN docker-php-ext-install mysqli

COPY 000-default.conf /etc/apache2/sites-available/000-default.conf

COPY start-apache /usr/local/bin
RUN chmod +x /usr/local/bin/start-apache

RUN a2enmod rewrite

COPY src /var/www/
RUN chown -R www-data:www-data /var/www

CMD ["start-apache"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'
services:
web:
# docker image build -t warehouse .
image: warehouse
ports:
- "8000:80"
db:
image: mysql:5.6
environment:
MYSQL_USER: admin
MYSQL_PASSWORD: root
MYSQL_DATABASE: oswa_inv
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
1 change: 1 addition & 0 deletions init_db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker-compose exec -T db mysql oswa_inv < migrations/oswa_inv.sql
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion includes/config.php → src/includes/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
|
|
*/
define( 'DB_HOST', 'localhost' ); // Set database host
define( 'DB_HOST', 'db' ); // Set database host
define( 'DB_USER', 'admin' ); // Set database user
define( 'DB_PASS', 'root' ); // Set database password
define( 'DB_NAME', 'oswa_inv' ); // Set database name
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion includes/load.php → src/includes/load.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

<?php
// -----------------------------------------------------------------------
// DEFINE SEPERATOR ALIASES
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
4 changes: 4 additions & 0 deletions start-apache
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
sed -i "s/Listen 80/Listen ${PORT:-80}/g" /etc/apache2/ports.conf
sed -i "s/:80/:${PORT:-80}/g" /etc/apache2/sites-enabled/*
apache2-foreground