forked from sunil-sahoo/opencart
-
Notifications
You must be signed in to change notification settings - Fork 0
154498035 Build Dockerfile.build and docker-compose for OpenCart #1
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
Open
artgo
wants to merge
1
commit into
master
Choose a base branch
from
docker-deploy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| deploy_on: | ||
| - comment | ||
| build: | ||
| commands: | ||
| - "make" | ||
| image: "testrigor/build-env" | ||
| compose: docker-compose.yml | ||
| setup: | ||
| - "make reset" | ||
| postfix: "" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # From Ubuntu 16.04 image | ||
| FROM ubuntu:16.04 | ||
|
|
||
| #Setting up Environment variables | ||
| ENV APACHE_RUN_USER www-data | ||
| ENV APACHE_RUN_GROUP www-data | ||
| ENV APACHE_LOG_DIR /var/log/apache2 | ||
| ENV APACHE_LOCK_DIR /var/lock/apache2 | ||
| ENV APACHE_PID_FILE /var/run/apache2.pid | ||
|
|
||
| #Install apache, php7, zip, curl | ||
| RUN set -xe \ | ||
| && apt-get update \ | ||
| && apt-get install -y apache2 zip curl \ | ||
| && apt-get install -y php7.0 php7.0-* libapache2-mod-php7.0 | ||
|
|
||
| #Set working directory to /var/www/html | ||
| WORKDIR /var/www/html | ||
|
|
||
| #Clean up and chown of html directory | ||
| RUN set -xe \ | ||
| && apt-get install -y snmp \ | ||
| && apt-get clean \ | ||
| && rm /var/www/html/index.html \ | ||
| && chown -R www-data:www-data /var/www/html | ||
|
|
||
| # Enable apache mods. | ||
| RUN a2enmod php7.0 | ||
| RUN a2enmod rewrite | ||
|
|
||
| # Update the PHP.ini file, enable <? ?> tags and quieten logging. | ||
| RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php/7.0/apache2/php.ini | ||
| RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.0/apache2/php.ini | ||
|
|
||
| #Expose port 80 | ||
| EXPOSE 80 | ||
|
|
||
| # Run apache on docker run | ||
| CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| FROM ubuntu:16.04 | ||
|
|
||
| RUN ["/bin/bash", "-c", "apt-get update && \ | ||
| apt-get install -y -f apt-transport-https apt-utils lsb-core software-properties-common && \ | ||
| apt-get install -y -f curl && \ | ||
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ | ||
| add-apt-repository \"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" && \ | ||
| apt-get update && \ | ||
| apt-get install -y docker-ce && \ | ||
| curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose && \ | ||
| chmod +x /usr/local/bin/docker-compose && \ | ||
| apt-get install -y -f mysql-client && \ | ||
| apt-get install -y -f zip git make && \ | ||
| apt-get install -y -f apache2 && \ | ||
| apt-get install -y -f php7.0-intl php-fdomdocument php7.0-curl php7.0-zip php7.0-xml php7.0-mbstring && \ | ||
| apt-get install -y -f composer"] | ||
|
|
||
| WORKDIR /project | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| .PHONY: * | ||
|
|
||
| all: init | ||
|
|
||
| build-base: | ||
| docker build -t build-env -f Dockerfile.build . | ||
|
|
||
| init: | ||
| mv /project/upload/config-dist.php /project/upload/config.php | ||
| mv /project/upload/admin/config-dist.php /project/upload/admin/config.php | ||
| chown -R www-data:www-data /project | ||
|
|
||
| reset: | ||
| docker exec -it opencart php /var/www/html/install/cli_install.php install --db_hostname mariadb --db_username root --db_password mariaSql --db_database opencart --db_driver mysqli --db_port 3306 --username admin --password opencartpass --email admin@myopencart.com --http_server http://13.57.225.143/ | ||
|
|
||
| up: | ||
| docker-compose up -d | ||
|
|
||
| down: | ||
| docker-compose down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| version: "3" | ||
|
|
||
| services: | ||
| mysql: | ||
| container_name: mariadb | ||
| image: mariadb | ||
| ports: | ||
| - "3306" | ||
| environment: | ||
| MYSQL_ROOT_PASSWORD: mariaSql | ||
| MYSQL_DATABASE: opencart | ||
| restart: always | ||
|
|
||
| web: | ||
| container_name: opencart | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| environment: | ||
| DB_PASSWD: mariaSql | ||
| DB_NAME: opencart | ||
| DB_SERVER: mysql | ||
| ports: | ||
| - "80:80" | ||
| links: | ||
| - mysql:database | ||
| volumes: | ||
| - ./upload:/var/www/html/ | ||
| restart: always | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeyanthimuthuram this is what I had in mind and this is how Sunil's code work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can't mount the volume while docker file is building