Skip to content

Commit

Permalink
fix: update docker config
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Jun 2, 2024
1 parent 5de00f9 commit 43b32f9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ networks:

services:
server:
build:
context: .
dockerfile: ./docker/Dockerfile
args:
- PHP_VERSION_SELECTED=${PHP_VERSION_SELECTED:-8.2}
# image: tanhong/new-mvc-shop:docker
# build:
# context: .
# dockerfile: ./docker/Dockerfile
# args:
# - PHP_VERSION_SELECTED=${PHP_VERSION_SELECTED:-8.2}
image: tanhong/new-mvc-shop:docker
container_name: '${APP_NAME:-new_mvc_shop}-server'
ports:
- '${APP_PORT:-85}:80'
Expand Down
15 changes: 12 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ set -a
source .env
set +a

# Check if .env file not exists
if [ ! -f .env ]; then
if [ -f .env ]; then
echo " ∟ .env file exists"
else
echo " ∟ Creating .env file"
cp .env.example .env
fi

docker compose up -d

docker compose run --rm -w /var/www/html server composer install
if [ -d vendor ]; then
echo " ∟ vendor directory exists"
echo " ∟ Running composer update"
docker compose run --rm -w /var/www/html server composer update
else
echo " ∟ Running composer install"
docker compose run --rm -w /var/www/html server composer install
fi

0 comments on commit 43b32f9

Please sign in to comment.