From dc26cc27da258180920ee36c912783c9626f777e Mon Sep 17 00:00:00 2001 From: Juan Felipe Zapata Moreno Date: Thu, 18 Sep 2025 13:52:21 -0600 Subject: [PATCH] first commit --- docker-compose.yml | 18 ++++++++++++++++++ dockerfile | 17 +++++++++++++++++ install.sh | 12 ++++++++---- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 docker-compose.yml create mode 100644 dockerfile diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..050a3c6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + gols-frontend-v1: + build: + context: . + dockerfile: dockerfile + ports: + - "${APP_PORT}:5173" + volumes: + - .:/var/www/gols-frontend-v1 + - frontend-v1:/var/www/gols-frontend-v1/node_modules + networks: + - gols-network +volumes: + frontend-v1: + driver: local +networks: + gols-network: + driver: bridge \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..9132f7f --- /dev/null +++ b/dockerfile @@ -0,0 +1,17 @@ +FROM node:22-alpine AS build + +WORKDIR /var/www/gols-frontend-v1 + +COPY install.sh /usr/local/bin/install.sh +RUN chmod +x /usr/local/bin/install.sh + +COPY package*.json ./ + +RUN npm install + +COPY . . + +EXPOSE 3000 + +ENTRYPOINT ["sh","/usr/local/bin/install.sh"] +CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"] diff --git a/install.sh b/install.sh index ce9133e..96438df 100755 --- a/install.sh +++ b/install.sh @@ -1,9 +1,13 @@ #! /bin/bash -npm install -cp .env.example .env -cp colors.json.example colors.json +if [ ! -f .env ]; then + cp .env.example .env +fi -npm run build +if [ ! -f colors.json ]; then + cp colors.json.example colors.json +fi + +exec "$@" echo "Done!" \ No newline at end of file