Skip to content
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

Update docker config #32

Merged
merged 7 commits into from
Jun 2, 2024
Merged
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
20 changes: 10 additions & 10 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ SMTP_UNAME
SMTP_PWORD

################### For docker ###################
APP_NAME
APP_NAME=nms

APP_PORT
SSL_PORT
APP_PORT=85
SSL_PORT=445

MYSQL_PORT
MYSQL_USER
MYSQL_ROOT_PASS
MYSQL_DB
MYSQL_PASS
MYSQL_PORT=13306
MYSQL_ROOT_PASS=root
MYSQL_DB=new_mvc_shop_db
MYSQL_USER=root
MYSQL_PASS=root

PHPMYADMIN_PORT
PHPMYADMIN_UPLOAD_LIMIT
PHPMYADMIN_PORT=8183
PHPMYADMIN_UPLOAD_LIMIT=1024M
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github: [tanhongit]
custom: ["https://paypal.me/tanhongcom"]
custom: ["https://www.paypal.com/paypalme/tanhongcom"]
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Support this project :stuck_out_tongue_winking_eye: :pray:
# 1. Configuration requirements
> - Web Server: Apache
> - Version PHP >= 8.0
> - Composer >= 2.0
> - OpenSSL PHP Extension
> - [Composer](https://getcomposer.org/download/) (Please install composer before running this project).
> - MySQL >= 8.0 (or MariaDB >= 10.0)
Expand Down Expand Up @@ -65,16 +66,16 @@ Clone the project to your computer:
git clone https://github.com/tanhongit/new-mvc-shop.git
```

Run composer install:
Copy the .env.example file to .env:

```bash
composer install
cp .env.example .env
```

Copy the .env.example file to .env:
Run composer install:

```bash
cp .env.example .env
composer install
```

# 6. Installation instructions
Expand Down Expand Up @@ -109,7 +110,7 @@ DB_HOST=db_server
DB_PORT=3306
DB_USER=root
DB_PASS=root
DB_NAME=chikoi
DB_NAME=new_mvc_shop_db
```

> **Note:**
Expand Down Expand Up @@ -177,7 +178,7 @@ Please edit the following information in the **.env** file:
**Example:**

```dotenv
APP_NAME=new-mvc-shop
APP_NAME=nms

APP_PORT=85
SSL_PORT=443 # (optional)
Expand All @@ -195,14 +196,13 @@ PHPMYADMIN_UPLOAD_LIMIT=2048M
Then, run the following command:

```bash
docker-compose up -d
docker compose up -d
```

After running the above command, you need to install the composer package for the project.

```bash
docker-compose exec server bash
composer install
docker compose run --rm -w /var/www/html server composer install
```

Finally, you need to import the database file into the database container.
Expand Down
2 changes: 1 addition & 1 deletion admin/database/.htaccess
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
deny form all
deny from all

# Developed by: TanHongIT
# Website: https://tanhongit.com - https://tanhongit.net
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion content/.htaccess
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
deny form all
deny from all

# Developed by: TanHongIT
# Website: https://tanhongit.com - https://tanhongit.net
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ services:
volumes:
- db_data:/var/lib/mysql
- ./docker/db/mariadb/my.cnf:/etc/mysql/conf.d/my.cnf
- ./admin/database:/var/lib/mysql/sql
networks:
- new_mvc_shop

Expand Down
9 changes: 7 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libjpeg62-turbo-dev \
libfreetype6-dev \
curl \
git \
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix to composer install

zip \
unzip \
libxml2-dev \
&& rm -r /var/lib/apt/lists/*

RUN a2enmod rewrite
RUN a2enmod ssl
RUN a2enmod rewrite && a2enmod ssl

RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
Expand All @@ -38,3 +41,5 @@ RUN chown -R www-data:www-data /var/www/html

EXPOSE 80
EXPOSE 443

CMD ["apache2-foreground"]
24 changes: 24 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -a
# shellcheck disable=SC1091
source .env
set +a

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

docker compose up -d

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
2 changes: 1 addition & 1 deletion lib/.htaccess
Original file line number Diff line number Diff line change
@@ -1 +1 @@
deny form all
deny from all
2 changes: 1 addition & 1 deletion logs/.htaccess
Original file line number Diff line number Diff line change
@@ -1 +1 @@
deny form all
deny from all
Loading