From d0df643332b8b7ca2eeb7d7463086bb4148eb6fd Mon Sep 17 00:00:00 2001 From: Tibor Leupold Date: Sat, 22 Jul 2023 19:02:34 -0700 Subject: [PATCH] Default Dockerfile to amd but use arm in compose The compose file is only used to local dev, so we can specify the arm/apple silicon here. --- Dockerfile | 7 ++++--- docker-compose.yaml | 8 ++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 78b8151b..b521b834 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18 as frontend +FROM node:18-bookworm-slim as frontend WORKDIR /home/node/app @@ -32,8 +32,9 @@ ENV PATH=${POETRY_HOME}/bin:$PATH \ RUN env # Install litestream (https://litestream.io/install/debian/) -RUN wget https://github.com/benbjohnson/litestream/releases/download/v0.3.9/litestream-v0.3.9-linux-amd64.deb -RUN dpkg -i litestream-v0.3.9-linux-amd64.deb +ARG PLATFORM=amd64 +RUN wget https://github.com/benbjohnson/litestream/releases/download/v0.3.9/litestream-v0.3.9-linux-$PLATFORM.deb +RUN dpkg -i litestream-v0.3.9-linux-$PLATFORM.deb # Install poetry RUN curl -sSL https://install.python-poetry.org | python3 - diff --git a/docker-compose.yaml b/docker-compose.yaml index f6ebd88a..2ddf9074 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,9 +3,8 @@ services: build: context: . target: backend-development - # Platforms need to be specified for the build to work on Apple Silicon Macs. - platforms: - - linux/amd64 + args: + - PLATFORM=arm64 command: ["tail", "-f", "/dev/null"] env_file: - .env @@ -20,9 +19,6 @@ services: build: context: . target: frontend - # Platforms need to be specified for the build to work on Apple Silicon Macs. - platforms: - - linux/amd64 command: ["tail", "-f", "/dev/null"] env_file: - .env