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

Fixes: Apache Startup and IP binding #52

Merged
merged 5 commits into from
Feb 2, 2021
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#################################################
.env
*.old
*.yaml
*.armhf
*.aarch64
*.x86_64
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ install:
- ./deploy.sh "$(arch)" --nobuild --exit

before_script:
- mkdir -p ${MYPHPCMS_LOG}
script:
- if [[ "${TRAVIS_OS_NAME}" != "linux" && "${COVERITY_SCAN_BRANCH:-0}" != 1 ]]; then ./test-cake.sh --travis --phpcs || true; fi
- if [[ "${TRAVIS_OS_NAME}" = "linux" && "${COVERITY_SCAN_BRANCH:-0}" != 1 ]]; then ./test-cake.sh --travis; fi
Expand All @@ -104,7 +105,7 @@ after_success:
- chmod +x send.sh
- "./send.sh success $WEBHOOK_URL"
- zip -r acake2php.zip * > /dev/null
- git tag --force "v${GIT_RELEASE_VERSION}.${TRAVIS_BUILD_NUMBER}"
- git tag --force "${GIT_RELEASE_VERSION}.${TRAVIS_BUILD_NUMBER}"
deploy:
provider: releases
api_key:
Expand Down
69 changes: 35 additions & 34 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ ARG PGID
ENV PGID ${PGID:-0}
# Must own the ip address
ARG HTTPD_LISTEN
ENV HTTPD_LISTEN ${HTTPD_LISTEN:-'0.0.0.0:80'}
ENV HTTPD_LISTEN ${HTTPD_LISTEN:-'*:80'}

# Use the default production configuration
#COPY $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
# RUN [ "cross-build-start" ]
RUN [ "cross-build-start" ]
RUN install_packages \
git \
openssh-client \
Expand All @@ -78,9 +78,6 @@ RUN install_packages \
libmemcached-dev
# libicu libicu-dev

# just containers configuration
COPY etc /etc

WORKDIR /usr/src/

COPY vagrant-shell.sh .
Expand All @@ -89,47 +86,51 @@ RUN ./vagrant-shell.sh php-settings-update extension memcached.so \
&& ./vagrant-shell.sh php-settings-update session.save_handler memcached \
&& ./vagrant-shell.sh php-settings-update session.save_path '127.0.0.1:11211,127.0.0.1:11212'

# Copy the source code into /var/www/html/ inside the image
COPY . /var/www/html/
WORKDIR /var/www/localhost/htdocs/

# Configure the application
WORKDIR /var/www/html/

# Change mode of bash Scripts
RUN chmod -R gu+xs deploy.sh configure.sh migrate-database.sh Scripts/
# Copy the app source code inside the image
COPY app app

# Add cake and composer command to system path
ENV PATH "${PATH}:/var/www/html/app/Console"
ENV PATH "${PATH}:/var/www/html/app/Vendor/bin"
COPY package.json .
COPY package-lock.json .

# Enable site on httpd
RUN Scripts/config_a2ensite.sh /var/www/html/app/webroot
# Helper packages
RUN npm link balena-cloud

# Add to hosts
RUN echo "127.0.0.1 ${SERVER_NAME}" | tee -a /etc/hosts
# Create tmp directory and make it writable by the web server
RUN mkdir -p \
app/tmp/cache/models \
app/tmp/cache/persistent \
app/tmp/cache/long \
app/tmp/logs \
&& chmod -R 1777 app/tmp

# Password Hash Verbose
# RUN cat app/webroot/php_cms/e13/etc/export_hash_password.sh | awk -F= '{print $2}' | tail -n 1
# Add cake and composer command to system path
COPY composer.json .
COPY composer.lock .
ENV PATH "${PATH}:/var/www/localhost/htdocs/app/Console"
ENV PATH "${PATH}:/var/www/localhost/htdocs/app/Vendor/bin"

# Set default working directory
WORKDIR app
# Configure the application
WORKDIR /var/www/localhost/htdocs/

# Create tmp directory and make it writable by the web server
RUN mkdir -p \
tmp/cache/models \
tmp/cache/persistent \
tmp/cache/long \
tmp/logs \
&& chmod -R 1777 tmp
# Copy the scripts code inside the image
COPY . .

# Helper packages
RUN npm link balena-cloud
# Change mode of bash Scripts
RUN chmod -R gu+xs deploy.sh configure.sh migrate-database.sh Scripts/

WORKDIR /var/www/html/
# Password Hash Verbose
# RUN cat app/webroot/php_cms/e13/etc/export_hash_password.sh | awk -F= '{print $2}' | tail -n 1

RUN chmod 0755 *.sh
RUN ./deploy.sh ${DKR_ARCH} --nobuild --exit \
&& ./configure.sh --openshift -m -c -h -p pass -s word --development
# RUN [ "cross-build-end" ]

# just containers configuration
COPY etc /etc

RUN [ "cross-build-end" ]

ENTRYPOINT ./migrate-database.sh -o -u -i --enable-authentication-plugin && /init
EXPOSE 80 443
67 changes: 34 additions & 33 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ARG CAKEPHP_DEBUG_LEVEL
ENV CAKEPHP_DEBUG_LEVEL ${CAKEPHP_DEBUG_LEVEL:-2}
ENV BALENA_MACHINE_NAME ${BALENA_MACHINE_NAME:-%%BALENA_MACHINE_NAME%%}
ARG SECONDARY_HUB
ENV SECONDARY_HUB ${SECONDARY_HUB:-'linuxserver\\/mariadb'}
ENV SECONDARY_HUB ${SECONDARY_HUB:-'linuxserver/mariadb'}
ENV DKR_ARCH ${DKR_ARCH:-%%BALENA_ARCH%%}
ARG COLLECT_COVERAGE
ENV COLLECT_COVERAGE ${COLLECT_COVERAGE:-'False'}
Expand Down Expand Up @@ -58,7 +58,7 @@ ARG PGID
ENV PGID ${PGID:-0}
# Must own the ip address
ARG HTTPD_LISTEN
ENV HTTPD_LISTEN ${HTTPD_LISTEN:-'0.0.0.0:80'}
ENV HTTPD_LISTEN ${HTTPD_LISTEN:-'*:80'}

# Use the default production configuration
#COPY $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
Expand All @@ -78,9 +78,6 @@ RUN install_packages \
libmemcached-dev
# libicu libicu-dev

# just containers configuration
COPY etc /etc

WORKDIR /usr/src/

COPY vagrant-shell.sh .
Expand All @@ -89,47 +86,51 @@ RUN ./vagrant-shell.sh php-settings-update extension memcached.so \
&& ./vagrant-shell.sh php-settings-update session.save_handler memcached \
&& ./vagrant-shell.sh php-settings-update session.save_path '127.0.0.1:11211,127.0.0.1:11212'

# Copy the source code into /var/www/html/ inside the image
COPY . /var/www/html/
WORKDIR /var/www/localhost/htdocs/

# Configure the application
WORKDIR /var/www/html/

# Change mode of bash Scripts
RUN chmod -R gu+xs deploy.sh configure.sh migrate-database.sh Scripts/
# Copy the app source code inside the image
COPY app app

# Add cake and composer command to system path
ENV PATH "${PATH}:/var/www/html/app/Console"
ENV PATH "${PATH}:/var/www/html/app/Vendor/bin"
COPY package.json .
COPY package-lock.json .

# Enable site on httpd
RUN Scripts/config_a2ensite.sh /var/www/html/app/webroot
# Helper packages
RUN npm link balena-cloud

# Add to hosts
RUN echo "127.0.0.1 ${SERVER_NAME}" | tee -a /etc/hosts
# Create tmp directory and make it writable by the web server
RUN mkdir -p \
app/tmp/cache/models \
app/tmp/cache/persistent \
app/tmp/cache/long \
app/tmp/logs \
&& chmod -R 1777 app/tmp

# Password Hash Verbose
# RUN cat app/webroot/php_cms/e13/etc/export_hash_password.sh | awk -F= '{print $2}' | tail -n 1
# Add cake and composer command to system path
COPY composer.json .
COPY composer.lock .
ENV PATH "${PATH}:/var/www/localhost/htdocs/app/Console"
ENV PATH "${PATH}:/var/www/localhost/htdocs/app/Vendor/bin"

# Set default working directory
WORKDIR app
# Configure the application
WORKDIR /var/www/localhost/htdocs/

# Create tmp directory and make it writable by the web server
RUN mkdir -p \
tmp/cache/models \
tmp/cache/persistent \
tmp/cache/long \
tmp/logs \
&& chmod -R 1777 tmp
# Copy the scripts code inside the image
COPY . .

# Helper packages
RUN npm link balena-cloud
# Change mode of bash Scripts
RUN chmod -R gu+xs deploy.sh configure.sh migrate-database.sh Scripts/

WORKDIR /var/www/html/
# Password Hash Verbose
# RUN cat app/webroot/php_cms/e13/etc/export_hash_password.sh | awk -F= '{print $2}' | tail -n 1

RUN chmod 0755 *.sh
RUN ./deploy.sh ${DKR_ARCH} --nobuild --exit \
&& ./configure.sh --openshift -m -c -h -p pass -s word --development

# just containers configuration
COPY etc /etc

# RUN [ "cross-build-end" ]

ENTRYPOINT ./migrate-database.sh -o -u -i --enable-authentication-plugin && /init
EXPOSE 80 443
65 changes: 33 additions & 32 deletions Dockerfile.x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ARG PGID
ENV PGID ${PGID:-0}
# Must own the ip address
ARG HTTPD_LISTEN
ENV HTTPD_LISTEN ${HTTPD_LISTEN:-'0.0.0.0:80'}
ENV HTTPD_LISTEN ${HTTPD_LISTEN:-'*:80'}

# Use the default production configuration
#COPY $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
Expand All @@ -78,9 +78,6 @@ RUN install_packages \
libmemcached-dev
# libicu libicu-dev

# just containers configuration
COPY etc /etc

WORKDIR /usr/src/

COPY vagrant-shell.sh .
Expand All @@ -89,47 +86,51 @@ RUN ./vagrant-shell.sh php-settings-update extension memcached.so \
&& ./vagrant-shell.sh php-settings-update session.save_handler memcached \
&& ./vagrant-shell.sh php-settings-update session.save_path '127.0.0.1:11211,127.0.0.1:11212'

# Copy the source code into /var/www/html/ inside the image
COPY . /var/www/html/
WORKDIR /var/www/localhost/htdocs/

# Configure the application
WORKDIR /var/www/html/

# Change mode of bash Scripts
RUN chmod -R gu+xs deploy.sh configure.sh migrate-database.sh Scripts/
# Copy the app source code inside the image
COPY app app

# Add cake and composer command to system path
ENV PATH "${PATH}:/var/www/html/app/Console"
ENV PATH "${PATH}:/var/www/html/app/Vendor/bin"
COPY package.json .
COPY package-lock.json .

# Enable site on httpd
RUN Scripts/config_a2ensite.sh /var/www/html/app/webroot
# Helper packages
RUN npm link balena-cloud

# Add to hosts
RUN echo "127.0.0.1 ${SERVER_NAME}" | tee -a /etc/hosts
# Create tmp directory and make it writable by the web server
RUN mkdir -p \
app/tmp/cache/models \
app/tmp/cache/persistent \
app/tmp/cache/long \
app/tmp/logs \
&& chmod -R 1777 app/tmp

# Password Hash Verbose
# RUN cat app/webroot/php_cms/e13/etc/export_hash_password.sh | awk -F= '{print $2}' | tail -n 1
# Add cake and composer command to system path
COPY composer.json .
COPY composer.lock .
ENV PATH "${PATH}:/var/www/localhost/htdocs/app/Console"
ENV PATH "${PATH}:/var/www/localhost/htdocs/app/Vendor/bin"

# Set default working directory
WORKDIR app
# Configure the application
WORKDIR /var/www/localhost/htdocs/

# Create tmp directory and make it writable by the web server
RUN mkdir -p \
tmp/cache/models \
tmp/cache/persistent \
tmp/cache/long \
tmp/logs \
&& chmod -R 1777 tmp
# Copy the scripts code inside the image
COPY . .

# Helper packages
RUN npm link balena-cloud
# Change mode of bash Scripts
RUN chmod -R gu+xs deploy.sh configure.sh migrate-database.sh Scripts/

WORKDIR /var/www/html/
# Password Hash Verbose
# RUN cat app/webroot/php_cms/e13/etc/export_hash_password.sh | awk -F= '{print $2}' | tail -n 1

RUN chmod 0755 *.sh
RUN ./deploy.sh ${DKR_ARCH} --nobuild --exit \
&& ./configure.sh --openshift -m -c -h -p pass -s word --development

# just containers configuration
COPY etc /etc

# RUN [ "cross-build-end" ]

ENTRYPOINT ./migrate-database.sh -o -u -i --enable-authentication-plugin && /init
EXPOSE 80 443
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,28 @@ The following additional variables must be set up as server secrets environment,
# Generated by ./configure.sh -h
GET_HASH_PASSWORD:<hashed-password>

MYSQL_DATABASE
aria_db

MYSQL_HOST
db

MYSQL_PASSWORD
maria-abc

MYSQL_ROOT_PASSWORD
mariadb

MYSQL_TCP_PORT
3306

MYSQL_USER
maria

SERVER_NAME
<Domain-Name>


### Database Configuration

An SQL server (must match remote server version) must be reachable by hostname or via its socket. If it's the 1st time you use this connection,
Expand Down
Loading