Skip to content

Commit

Permalink
Merge pull request #9 from wanasyraf96/include-required-folder
Browse files Browse the repository at this point in the history
Improve build
  • Loading branch information
pyhrus authored Apr 3, 2023
2 parents dfc433f + ff41182 commit a2f0de1
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 12 deletions.
17 changes: 17 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM bitnami/opencart:3.0.3-6-debian-10-r64

ENV OPENCART_ROOT_DIR=/opt/bitnami/opencart

# Copy setup script
ADD ./assets/setup.sh /tmp/setup.sh

# RUN setup
RUN chmod +x /tmp/setup.sh
RUN /tmp/setup.sh

# Copy plugin files
COPY ./bin/tawkto/admin/controller/extension /opt/bitnami/opencart/admin/controller/extension
COPY ./bin/tawkto/admin/language/en-gb/extension /opt/bitnami/opencart/admin/language/en-gb/extension
COPY ./bin/tawkto/admin/view /opt/bitnami/opencart/admin/view
COPY --chown=daemon:daemon ./bin/tawkto/catalog/controller/extension /opt/bitnami/opencart/catalog/controller/extension
COPY --chown=daemon:daemon ./bin/tawkto/catalog/view/theme/default /opt/bitnami/opencart/catalog/view/theme/default
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
set -e;

build_dir=$(dirname $0);
module_dir=$build_dir/bin/tawkto;

if [ -d "$module_dir" ]; then
echo "Removing existing module folder";
rm -r $module_dir;
fi

echo "Creating module folder";
mkdir -p $module_dir;

echo "Installing dependencies"
composer run release --working-dir=$build_dir/..

echo "Copying files to module folder";
cp -r $build_dir/../tmp/* $module_dir

echo "Done building module folder";

echo "Building docker image"
docker-compose build
10 changes: 0 additions & 10 deletions docker/build/Dockerfile

This file was deleted.

7 changes: 5 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ services:
- ALLOW_EMPTY_PASSWORD=yes

web:
container_name: opencart-30
depends_on:
- db
build: ./build
build: .
ports:
- 8000:8000
- 8443:8443
environment:
- MARIADB_HOST=db
- MARIADB_PORT_NUMBER=3306
- OPENCART_DATABASE_HOST=db
- OPENCART_DATABASE_PORT_NUMBER=3306
- OPENCART_DATABASE_USER=bn_opencart
- OPENCART_DATABASE_NAME=bitnami_opencart
- OPENCART_USERNAME=admin
Expand All @@ -30,7 +33,7 @@ services:
- APACHE_HTTPS_PORT_NUMBER=8443
volumes:
- web_data:/bitnami
- ./aliases:/opt/bitnami/apache/conf/aliases
- ./assets/multistore.conf:/opt/bitnami/apache/conf/aliases/multistore.conf

volumes:
db_data:
Expand Down

0 comments on commit a2f0de1

Please sign in to comment.