From 559e38853cc5c4e5520d013a562dc69e29c89810 Mon Sep 17 00:00:00 2001 From: Kaare Larsen Date: Fri, 26 Apr 2024 16:21:47 +0200 Subject: [PATCH] restoring Dockerfile.dev --- docker-compose.yml | 5 +++-- services/web/Dockerfile.dev | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 services/web/Dockerfile.dev diff --git a/docker-compose.yml b/docker-compose.yml index 3e26f501..331570f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - ./services/api/.env:/service/.env - ./services/api/openapi:/service/openapi ports: - - '2300:2300' + - "2300:2300" links: - mongo depends_on: @@ -24,13 +24,14 @@ services: web: build: context: ./services/web + dockerfile: Dockerfile.dev args: NODE_ENV: development command: yarn start volumes: - ./services/web/src:/service/src ports: - - '2200:2200' + - "2200:2200" depends_on: - api diff --git a/services/web/Dockerfile.dev b/services/web/Dockerfile.dev new file mode 100644 index 00000000..51fafff7 --- /dev/null +++ b/services/web/Dockerfile.dev @@ -0,0 +1,20 @@ +FROM node:20.12.2-alpine + +# Note layers should be ordered from less to more likely to change. + +# Update & install required packages +RUN apk add --update bash curl; + +# Set work directory +WORKDIR /service + +# Copy app source +COPY . . + +RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --frozen-lockfile + + +EXPOSE 2200 + +CMD ["yarn", "start"] + \ No newline at end of file