mirror of
https://github.com/supanadit/todo.git
synced 2024-11-10 09:52:19 +00:00
feat: apache dev mode
This commit is contained in:
parent
730763a58a
commit
8a254b4176
@ -1,10 +1,20 @@
|
|||||||
FROM php:7.4-fpm
|
FROM php:7.4-apache
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
|
||||||
RUN apt-get install -y git zip
|
RUN apt-get install -y git zip
|
||||||
|
|
||||||
|
# Set Apache Root
|
||||||
|
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
|
||||||
|
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
|
||||||
|
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
|
||||||
|
|
||||||
|
# Enable Some Apache Mod
|
||||||
|
RUN a2enmod rewrite headers
|
||||||
|
|
||||||
RUN docker-php-ext-install pdo pdo_mysql
|
RUN docker-php-ext-install pdo pdo_mysql
|
||||||
|
|
||||||
|
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
|
||||||
|
|
||||||
# Composer
|
# Composer
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
10
README.md
10
README.md
@ -83,25 +83,25 @@ docker-compose -f docker-compose.dev.yml up -d
|
|||||||
### Installing / Updating Dependencies
|
### Installing / Updating Dependencies
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose -f docker-compose.dev.yml exec -w /srv todo composer install # Composer Install
|
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo composer install # Composer Install
|
||||||
```
|
```
|
||||||
|
|
||||||
### Generate Key
|
### Generate Key
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose -f docker-compose.dev.yml exec -w /srv todo php artisan key:generate # Generate Key
|
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo php artisan key:generate # Generate Key
|
||||||
```
|
```
|
||||||
|
|
||||||
### Database Migration
|
### Database Migration
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose -f docker-compose.dev.yml exec -w /srv todo php artisan migrate
|
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo php artisan migrate
|
||||||
```
|
```
|
||||||
|
|
||||||
### Database Seed
|
### Database Seed
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose -f docker-compose.dev.yml exec -w /srv todo php artisan db:seed
|
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo php artisan db:seed
|
||||||
```
|
```
|
||||||
|
|
||||||
### Shutdown Application
|
### Shutdown Application
|
||||||
@ -113,7 +113,7 @@ docker-compose -f docker-compose.dev.yml down
|
|||||||
### Updating `.env`
|
### Updating `.env`
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose -f docker-compose.dev.yml exec -w /srv todo php artisan config:cache
|
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo php artisan config:cache
|
||||||
```
|
```
|
||||||
|
|
||||||
### Rebuilding Dockerfile
|
### Rebuilding Dockerfile
|
||||||
|
@ -4,16 +4,10 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: PHP.Dockerfile
|
dockerfile: PHP.Dockerfile
|
||||||
volumes:
|
|
||||||
- "./:/srv"
|
|
||||||
|
|
||||||
caddy:
|
|
||||||
image: caddy:2.5.0-alpine
|
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
volumes:
|
volumes:
|
||||||
- "./Caddyfile:/etc/caddy/Caddyfile"
|
- "./:/var/www/html"
|
||||||
- "./:/srv"
|
|
||||||
|
|
||||||
mysqldb:
|
mysqldb:
|
||||||
image: "bitnami/mysql:8.0"
|
image: "bitnami/mysql:8.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user