mirror of
https://github.com/supanadit/todo.git
synced 2024-11-25 03:46:24 +00:00
feat: php docker cli
This commit is contained in:
parent
8a254b4176
commit
8bb631c172
@ -1,20 +1,15 @@
|
||||
FROM php:7.4-apache
|
||||
FROM php:7.4-cli
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
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 mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
# Composer
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
|
||||
|
||||
WORKDIR /todo
|
||||
CMD [ "php", "artisan","serve" ,"--host","0.0.0.0"]
|
10
README.md
10
README.md
@ -83,25 +83,25 @@ docker-compose -f docker-compose.dev.yml up -d
|
||||
### Installing / Updating Dependencies
|
||||
|
||||
```bash
|
||||
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo composer install # Composer Install
|
||||
docker-compose -f docker-compose.dev.yml exec -w /todo todo composer install # Composer Install
|
||||
```
|
||||
|
||||
### Generate Key
|
||||
|
||||
```bash
|
||||
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo php artisan key:generate # Generate Key
|
||||
docker-compose -f docker-compose.dev.yml exec -w /todo todo php artisan key:generate # Generate Key
|
||||
```
|
||||
|
||||
### Database Migration
|
||||
|
||||
```bash
|
||||
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo php artisan migrate
|
||||
docker-compose -f docker-compose.dev.yml exec -w /todo todo php artisan migrate
|
||||
```
|
||||
|
||||
### Database Seed
|
||||
|
||||
```bash
|
||||
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo php artisan db:seed
|
||||
docker-compose -f docker-compose.dev.yml exec -w /todo todo php artisan db:seed
|
||||
```
|
||||
|
||||
### Shutdown Application
|
||||
@ -113,7 +113,7 @@ docker-compose -f docker-compose.dev.yml down
|
||||
### Updating `.env`
|
||||
|
||||
```bash
|
||||
docker-compose -f docker-compose.dev.yml exec -w /var/www/html todo php artisan config:cache
|
||||
docker-compose -f docker-compose.dev.yml exec -w /todo todo php artisan config:cache
|
||||
```
|
||||
|
||||
### Rebuilding Dockerfile
|
||||
|
@ -5,9 +5,9 @@ services:
|
||||
context: .
|
||||
dockerfile: PHP.Dockerfile
|
||||
ports:
|
||||
- "80:80"
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- "./:/var/www/html"
|
||||
- "./:/todo"
|
||||
|
||||
mysqldb:
|
||||
image: "bitnami/mysql:8.0"
|
||||
|
Loading…
Reference in New Issue
Block a user