From b571f08b4d2bddf8ebbcd051cee159a9d87b096e Mon Sep 17 00:00:00 2001 From: julisous Date: Thu, 26 Oct 2023 18:06:52 -0300 Subject: [PATCH] :bug: (#170) Fazendo alteracoes no dockerfile --- Dockerfile | 5 +++-- docker-compose.dev.yml => docker-compose.yml | 4 ++-- package.json | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) rename docker-compose.dev.yml => docker-compose.yml (85%) diff --git a/Dockerfile b/Dockerfile index 16a64268..e43b388e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM node:17-alpine AS development +FROM node:16-alpine AS development ENV NODE_ENV development -# Diretorio +# Directory WORKDIR /app # Instalacao das dependencias COPY package.json . @@ -9,6 +9,7 @@ COPY yarn.lock . RUN yarn install # Copia arquivos do src COPY . . +RUN yarn build # Expoe a porta EXPOSE 3000 # Inicia o programa diff --git a/docker-compose.dev.yml b/docker-compose.yml similarity index 85% rename from docker-compose.dev.yml rename to docker-compose.yml index ea582d3d..30799aa8 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ version: '3.8' -service: +services: app: container_name: app-front image: app-front build: - context: + context: . target: development volumes: - ./src:/app/src diff --git a/package.json b/package.json index 7b0ba032..37fea3ab 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "test": "react-scripts test --watchAll=false --coverage", "test:watch": "react-scripts test", "eject": "react-scripts eject", - "lint": "eslint --ext .{tjs,jsx}" + "lint": "eslint --ext .{tjs,jsx}", + "dev": "docker-compose -d docker-compose.yml up" }, "eslintConfig": { "extends": [