diff --git a/.dockerignore b/.dockerignore index d18c8e0..b9e4842 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 ee774e3..8b85467 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 39511ae..df495e7 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"