Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Commit

Permalink
Fixed composer version to 2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
desmondsow committed Jan 6, 2022
1 parent 1a40fd7 commit 9edbbed
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ MQTT_TLS_CLIENT_CERTIFICATE_KEY_PASSPHRASE=null
CHANGE_SOURCE=false


### COMPOSER #################################################

COMPOSER_VERSION=2.2.3


### APP PHP #################################################

PHP_VERSION=8.0-fpm
Expand Down
1 change: 1 addition & 0 deletions docker-compose.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
context: ./
dockerfile: docker-compose/app/Dockerfile.staging
args:
- COMPOSER_VERSION=${COMPOSER_VERSION}
- PHP_VERSION=${PHP_VERSION}
- LOCAL_UID=${LOCAL_UID}
- LOCAL_GID=${LOCAL_GID}
Expand Down
9 changes: 7 additions & 2 deletions docker-compose/app/Dockerfile.staging
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
# SPDX-License-Identifier: MIT
#

ARG COMPOSER_VERSION=latest

ARG PHP_VERSION=fpm

FROM composer:${COMPOSER_VERSION} AS inteliotportal-composer

FROM php:${PHP_VERSION}

ARG LOCAL_UID=65534
Expand Down Expand Up @@ -43,8 +48,8 @@ RUN pecl install -o -f redis \

RUN rm -r /var/www/*

# Get latest Composer TODO: remove in future
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Get Composer TODO: remove in future
COPY --from=inteliotportal-composer /usr/bin/composer /usr/bin/composer

COPY --from=inteliotportal-build --chown=$LOCAL_UID:$LOCAL_GID /var/www /var/www/

Expand Down
9 changes: 7 additions & 2 deletions docker-compose/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
# SPDX-License-Identifier: MIT
#

ARG COMPOSER_VERSION=latest

ARG PHP_VERSION=fpm

FROM composer:${COMPOSER_VERSION} AS inteliotportal-composer

FROM php:${PHP_VERSION} AS inteliotportal-build

# Install PHP and composer dependencies
Expand Down Expand Up @@ -35,8 +40,8 @@ RUN pecl install -o -f redis \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip \
&& docker-php-ext-enable redis

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Get Composer
COPY --from=inteliotportal-composer /usr/bin/composer /usr/bin/composer

# Install NodeJS
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
Expand Down
8 changes: 3 additions & 5 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ function install() {

dockerComposeVolumes

source ../.env.staging
source ../.env.staging && export COMPOSER_VERSION PHP_VERSION

export PHP_VERSION

docker build --no-cache -t inteliotportal-build --build-arg HOSTNAME=$DOMAIN --build-arg PHP_VERSION \
-f $DOCKER_DIR/build/Dockerfile $PORTAL_DIR
docker build --no-cache -t inteliotportal-build --build-arg HOSTNAME=$DOMAIN --build-arg COMPOSER_VERSION \
--build-arg PHP_VERSION -f $DOCKER_DIR/build/Dockerfile $PORTAL_DIR

docker run --rm --name setup -v $DATA_DIR:/iotportaldata --env-file $ENV_DIR/uid.env inteliotportal-build

Expand Down

0 comments on commit 9edbbed

Please sign in to comment.