From 47a622236369ca4ced2b383364818cb797d1b735 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 7 Dec 2020 15:43:09 -0300 Subject: [PATCH] =?UTF-8?q?simplificar=20compilaci=C3=B3n=20de=20assets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 4 ++-- Dockerfile | 4 ++-- Makefile | 11 ++++------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.dockerignore b/.dockerignore index d18c8e0f..b9e4842e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,5 +6,5 @@ !./Gemfile !./Gemfile.lock !./config/credentials.yml.enc -!./public/assets-production/ -!./public/packs-production/ +!./public/assets/ +!./public/packs/ diff --git a/Dockerfile b/Dockerfile index ee774e38..8b854678 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,8 +56,8 @@ RUN mv ../sutty/.bundle ./.bundle # Instalar secretos COPY --chown=app:root ./config/credentials.yml.enc ./config/ # Traer los assets pre-compilados -COPY --chown=app:www-data ./public/assets-production ./public/assets -COPY --chown=app:www-data ./public/packs-production ./public/packs +COPY --chown=app:www-data ./public/assets ./public/assets +COPY --chown=app:www-data ./public/packs ./public/packs # Eliminar la necesidad de un runtime JS en producción, porque los # assets ya están pre-compilados. diff --git a/Makefile b/Makefile index 39511ae9..df495e7d 100644 --- a/Makefile +++ b/Makefile @@ -9,14 +9,10 @@ assets := package.json yarn.lock $(shell find app/assets/ app/javascript/ -type alpine_version := 3.12 -public/assets-production/: $(assets) - RAILS_ENV=production bundle exec rake assets:precompile assets:clean - rsync --delete-after -a public/assets/ $@ +public/packs/manifest.json: $(assets) + PANEL_URL=https://panel.sutty.nl RAILS_ENV=production NODE_ENV=production bundle exec rake assets:precompile assets:clean -public/packs-production/: public/packs/ - rsync -a --delete-after $< $@ - -assets: public/assets-production/ public/packs-production/ +assets: public/packs/manifest.json serve: bundle exec rails s -b "ssl://0.0.0.0:3000?key=../sutty.local/domain/sutty.local.key&cert=../sutty.local/domain/sutty.local.crt" @@ -33,6 +29,7 @@ build: assets save: time docker save sutty/sutty:latest | ssh root@$(delegate).sutty.nl docker load date +%F | xargs git tag -f + @echo -e "\a" load: ssh root@sutty.nl sh -c "gunzip -c sutty.latest.gz | docker load"