Skip to content

Commit 60379e7

Browse files
committed
comprehensive IaC review
1 parent b035406 commit 60379e7

File tree

11 files changed

+546
-80
lines changed

11 files changed

+546
-80
lines changed

.github/workflows/build_deploy_and_test.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Configure AWS credentials
8181
uses: aws-actions/configure-aws-credentials@v4
8282
with:
83-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
83+
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
8484
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
8585
aws-region: ${{ vars.AWS_REGION }}
8686
- name: Log in to Amazon ECR
@@ -95,15 +95,6 @@ jobs:
9595
${{ vars.ECR_REPOSITORY_URL }}:${{ github.sha }}
9696
${{ vars.ECR_REPOSITORY_URL }}:latest
9797
file: ./Dockerfile
98-
build-args: |
99-
MYSQL_HOST=${{ vars.AWS_MYSQL_HOST }}
100-
MYSQL_TCP_PORT=${{ vars.AWS_MYSQL_TCP_PORT }}
101-
MYSQL_USER=${{ vars.AWS_MYSQL_USER }}
102-
MYSQL_PASSWORD=${{ secrets.AWS_MYSQL_PASSWORD }}
103-
MYSQL_DATABASE=${{ vars.AWS_MYSQL_DATABASE }}
104-
REDIS_HOST=${{ vars.AWS_REDIS_HOST }}
105-
REDIS_AUTH=${{ secrets.AWS_REDIS_AUTH }}
106-
HASH_SALT=${{ secrets.AWS_HASH_SALT }}
10798

10899
lint:
109100
name: Check lint
@@ -283,7 +274,7 @@ jobs:
283274
- name: Configure AWS credentials
284275
uses: aws-actions/configure-aws-credentials@v4
285276
with:
286-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
277+
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
287278
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
288279
aws-region: ${{ vars.AWS_REGION }}
289280
- name: Update ECS service with new image

Dockerfile

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# check=skip=SecretsUsedInArgOrEnv
2-
31
FROM ghcr.io/uceap/devcontainer-drupal:v2.3.0
42

53
# Install SSH server
@@ -12,23 +10,13 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
1210
COPY docker-uceap-entrypoint /usr/local/bin/docker-uceap-entrypoint
1311
ENTRYPOINT ["docker-uceap-entrypoint"]
1412

15-
ARG MYSQL_HOST
16-
ARG MYSQL_TCP_PORT
17-
ARG MYSQL_USER
18-
ARG MYSQL_PASSWORD
19-
ARG MYSQL_DATABASE
20-
ARG REDIS_HOST
21-
ARG REDIS_AUTH
22-
ARG HASH_SALT
23-
2413
COPY build /var/www/build
2514
COPY config /var/www/config
2615
COPY composer.json /var/www/
2716
COPY web /var/www/web
2817

2918
WORKDIR /var/www
3019

31-
RUN composer initialize-container && \
32-
composer install --no-dev --no-interaction --no-progress --optimize-autoloader && \
20+
RUN composer install --no-dev --no-interaction --no-progress --optimize-autoloader && \
3321
sed -i 's-/var/www/html-/var/www/web-' /etc/apache2/sites-available/*.conf && \
3422
sed -i 's/# Listen\s*80$/Listen 80/' /etc/apache2/ports.conf

docker-uceap-entrypoint

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/bin/sh
22
set -e
33

4+
# Initialize Drupal container with runtime environment variables
5+
# This runs at container startup with secrets from AWS Secrets Manager
6+
cd /var/www && composer initialize-container
7+
48
service ssh start
59

610
exec apache2-foreground

0 commit comments

Comments
 (0)