From c4f18c0f6c85c27caec1c1cd2238caf2615146ea Mon Sep 17 00:00:00 2001 From: Filipe Veloso <2469500+Rovel@users.noreply.github.com> Date: Sat, 2 Mar 2024 15:33:29 +0000 Subject: [PATCH] add compose dev and upgrade node image --- Dockerfile | 17 ++++++++++++----- docker-compose.dev.yaml | 11 +++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 docker-compose.dev.yaml diff --git a/Dockerfile b/Dockerfile index 3133050a..06050e12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,27 @@ # Build stage -FROM node:16-buster-slim AS build +FROM node:20-buster-slim AS base WORKDIR /app COPY package.json yarn.lock ./ -RUN apt-get update && \ - yarn install --production && \ +RUN apt update -y && \ + apt upgrade -y + +FROM base as dev + +RUN yarn && \ rm -rf /app/node_modules/.cache +ENTRYPOINT ["yarn"] +FROM base AS build COPY . . -RUN yarn build --production +RUN yarn build --production && \ + rm -rf /app/node_modules/.cache # Final stage -FROM node:16-buster-slim AS final +FROM node:20-buster-slim AS final WORKDIR /app diff --git a/docker-compose.dev.yaml b/docker-compose.dev.yaml new file mode 100644 index 00000000..5ae7ccc2 --- /dev/null +++ b/docker-compose.dev.yaml @@ -0,0 +1,11 @@ +version: '3.9' +services: + web-check: + container_name: Web-Check + command: dev + build: + target: dev + volumes: + - ./:/app + ports: + - 8080:8888 \ No newline at end of file