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

LPAL-1231 take apk upgrade out of api dockerfile. #1571

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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 docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ services:
volumes:
- ./local-config/:/app/
environment:
AWS_ACCESS_KEY_ID: "-"
AWS_SECRET_ACCESS_KEY: "-"
AWS_ACCESS_KEY_ID: "devkey"
AWS_SECRET_ACCESS_KEY: "devkey"
AWS_ENDPOINT_DYNAMODB: dynamodb:8000

OPG_LPA_COMMON_SQS_ENDPOINT: localstack:4566
Expand Down Expand Up @@ -186,8 +186,8 @@ services:
OPG_LPA_FRONT_CSRF_SALT: "test"

# Local only
AWS_ACCESS_KEY_ID: "-"
AWS_SECRET_ACCESS_KEY: "-"
AWS_ACCESS_KEY_ID: "devkey"
AWS_SECRET_ACCESS_KEY: "devkey"

OPG_LPA_COMMON_DYNAMODB_ENDPOINT: http://dynamodb:8000

Expand Down Expand Up @@ -305,8 +305,8 @@ services:
OPG_LPA_COMMON_ADMIN_ACCOUNTS: "${OPG_LPA_COMMON_ADMIN_ACCOUNTS}"

# Local only
AWS_ACCESS_KEY_ID: "-"
AWS_SECRET_ACCESS_KEY: "-"
AWS_ACCESS_KEY_ID: "devkey"
AWS_SECRET_ACCESS_KEY: "devkey"

OPG_LPA_COMMON_DYNAMODB_ENDPOINT: http://dynamodb:8000
OPG_LPA_COMMON_S3_ENDPOINT: http://localstack:4566
Expand Down Expand Up @@ -381,8 +381,8 @@ services:
OPG_LPA_ADMIN_JWT_SECRET: "test-secret"

# Local only
AWS_ACCESS_KEY_ID: "-"
AWS_SECRET_ACCESS_KEY: "-"
AWS_ACCESS_KEY_ID: "devkey"
AWS_SECRET_ACCESS_KEY: "devkey"

OPG_LPA_COMMON_DYNAMODB_ENDPOINT: http://dynamodb:8000

Expand Down Expand Up @@ -443,8 +443,8 @@ services:
OPG_LPA_COMMON_PDF_CACHE_S3_BUCKET: "lpacache"

# Local only
AWS_ACCESS_KEY_ID: "-"
AWS_SECRET_ACCESS_KEY: "-"
AWS_ACCESS_KEY_ID: "devkey"
AWS_SECRET_ACCESS_KEY: "devkey"

OPG_LPA_COMMON_S3_ENDPOINT: http://localstack:4566
OPG_LPA_COMMON_PDF_QUEUE_URL: http://localstack:4566/000000000000/pdf-queue.fifo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ docker pull 311462405659.dkr.ecr.eu-west-1.amazonaws.com/online-lpa/api_app:late
run the image up, enable xdebug on the container and run the tests, using the following commands:

``` bash
docker run -d --env AWS_ACCESS_KEY_ID='-' --env AWS_SECRET_ACCESS_KEY='-' --name api-tests 311462405659.dkr.ecr.eu-west-1.amazonaws.com/online-lpa/api_app:latest
docker run -d --env AWS_ACCESS_KEY_ID='devkey' --env AWS_SECRET_ACCESS_KEY='devkey' --name api-tests 311462405659.dkr.ecr.eu-west-1.amazonaws.com/online-lpa/api_app:latest
docker exec api-tests docker-php-ext-enable xdebug
docker exec api-tests /app/vendor/bin/phpunit -d memory_limit=256M

Expand All @@ -88,11 +88,11 @@ docker exec api-tests /app/vendor/bin/phpunit -d memory_limit=256M
3. set image name (as in previous step)
4. set container name as set in previous step
5. you may need to set AWS environment variables - these should be all you need:
1. `AWS_ACCESS_KEY_ID='-'; AWS_SECRET_ACCESS_KEY='-'`
1. `AWS_ACCESS_KEY_ID='devkey'; AWS_SECRET_ACCESS_KEY='devkey'`
6. in the command preview you will see the constructed command look like this:

``` bash
docker run -P --env AWS_ACCESS_KEY_ID='-' --env AWS_SECRET_ACCESS_KEY='-' --name api-tests 311462405659.dkr.ecr.eu-west-1.amazonaws.com/online-lpa/api_app:latest
docker run -P --env AWS_ACCESS_KEY_ID='devkey' --env AWS_SECRET_ACCESS_KEY='devkey' --name api-tests 311462405659.dkr.ecr.eu-west-1.amazonaws.com/online-lpa/api_app:latest
```

## Setting up debugging of PHPUnit tests in PHPStorm
Expand Down Expand Up @@ -124,7 +124,7 @@ This consists of 3 main steps:
7. connect to a running instance of the image above to work this out.

``` bash
docker run -d --env AWS_ACCESS_KEY_ID='-' --env AWS_SECRET_ACCESS_KEY='-' --name api-tests 311462405659.dkr.ecr.eu-west-1.amazonaws.com/online-lpa/api_app:latest
docker run -d --env AWS_ACCESS_KEY_ID='devkey' --env AWS_SECRET_ACCESS_KEY='devkey' --name api-tests 311462405659.dkr.ecr.eu-west-1.amazonaws.com/online-lpa/api_app:latest
docker exec -it api-tests sh
```

Expand Down
3 changes: 1 addition & 2 deletions service-api/docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ ENV OPG_PHP_POOL_CHILDREN_MAX="25"

RUN adduser -D -g '' appuser

RUN apk add --upgrade --no-cache apk-tools
RUN apk upgrade --no-cache
RUN apk add --no-cache apk-tools

RUN apk add --no-cache postgresql-libs icu fcgi \
&& apk add --update --no-cache --virtual .build-dependencies $PHPIZE_DEPS postgresql-dev icu-dev linux-headers \
Expand Down
Loading