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

🐳 AWS: Docker platform config 🐳 #298

Merged
merged 3 commits into from
Mar 3, 2025
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
25 changes: 15 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,21 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: residents
IMAGE_TAG: sha-${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/arm64
push: true
tags: |
${{ steps.login-ecr.outputs.registry }}/$ECR_REPOSITORY:latest
${{ steps.login-ecr.outputs.registry }}/$ECR_REPOSITORY:sha-${{ github.sha }}

publish-to-npm:
needs: build-test-and-coverage
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Specify the base image
FROM node:20
FROM --platform=linux/arm64 node:20

# Set the working directory inside the container
WORKDIR /usr/src/app
Expand Down
6 changes: 1 addition & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ version: '3.8'

services:
app:
build:
context: .
# Platform suits EC2 config
platform: linux/arm64
build: .
ports:
- "${DOCKER_API_PORT}:3000"
environment:
Expand Down Expand Up @@ -35,7 +32,6 @@ services:
- postgres
postgres:
image: postgres:latest
platform: linux/arm64
restart: always
environment:
POSTGRES_DB: ${POSTGRES_DB}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "residents",
"version": "0.2.24",
"version": "0.2.25",
"author": "Conor Luddy <conorluddy@gmail.com>",
"license": "MIT",
"description": "Residents is a Node.js Express back-end foundation designed for bootstrapping new projects quickly and efficiently. Its main goal is to set up a robust infrastructure for user management, because users are the core of any application. These users are your Residents. It leverages a robust stack including Postgres, Drizzle ORM, JWT, PassportJS, Docker and Swagger to streamline development and deployment processes.",
Expand Down