diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38a10a1..0753cad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + driver: docker + - name: Build images run: docker compose -f cicd/docker/docker-compose.yml build diff --git a/cicd/docker/Dockerfile.frontend b/cicd/docker/Dockerfile.frontend index c0ec7be..fa9d33e 100644 --- a/cicd/docker/Dockerfile.frontend +++ b/cicd/docker/Dockerfile.frontend @@ -1,5 +1,5 @@ # Build stage -FROM public.ecr.aws/docker/library/node:22-alpine AS build +FROM node:22-alpine AS build WORKDIR /app # Install dependencies — copy lockfiles first to cache the npm layer @@ -18,7 +18,7 @@ COPY src/frontend/public/ ./public/ RUN npm run build # Serve stage -FROM public.ecr.aws/docker/library/nginx:alpine AS runtime +FROM nginx:alpine AS runtime COPY --from=build /app/dist /usr/share/nginx/html COPY cicd/docker/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/cicd/docker/docker-compose.yml b/cicd/docker/docker-compose.yml index b440b2e..4a94a8f 100644 --- a/cicd/docker/docker-compose.yml +++ b/cicd/docker/docker-compose.yml @@ -1,6 +1,6 @@ services: backend: - image: randall/backend:latest + image: localhost/randall/backend:latest build: context: ../.. dockerfile: cicd/docker/Dockerfile.backend @@ -21,7 +21,7 @@ services: start_period: 10s frontend: - image: randall/frontend:latest + image: localhost/randall/frontend:latest build: context: ../.. dockerfile: cicd/docker/Dockerfile.frontend