simplificar compilación de assets
This commit is contained in:
parent
baa7d58715
commit
47a6222363
3 changed files with 8 additions and 11 deletions
|
@ -6,5 +6,5 @@
|
|||
!./Gemfile
|
||||
!./Gemfile.lock
|
||||
!./config/credentials.yml.enc
|
||||
!./public/assets-production/
|
||||
!./public/packs-production/
|
||||
!./public/assets/
|
||||
!./public/packs/
|
||||
|
|
|
@ -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.
|
||||
|
|
11
Makefile
11
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"
|
||||
|
|
Loading…
Reference in a new issue