From 5ffef95186651422b3704f28dbf48157bf9015bd Mon Sep 17 00:00:00 2001 From: f Date: Thu, 30 Apr 2020 18:06:21 -0300 Subject: [PATCH] actualizar alpine y habilitar links duros --- Dockerfile | 13 ++++++++----- Gemfile | 1 + config/storage.yml | 10 +--------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a5978b3..2fb45730 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # como el tarball van a tener que cambiar porque ya vamos a haber hecho # un clone/pull limpio. FROM sutty/oxipng:latest as oxipng -FROM alpine:3.11 as build +FROM alpine:3.11.6 as build MAINTAINER "f " ARG RAILS_MASTER_KEY @@ -61,7 +61,7 @@ RUN find public -type f -name "*.gz" | sed -re "s/\.gz$//" | xargs -r brotli -k # Eliminar la necesidad de un runtime JS en producción, porque los # assets ya están pre-compilados. -RUN sed -re "/(uglifier|bootstrap|coffee-rails)/d" -i Gemfile +RUN sed -re "/(sassc|uglifier|bootstrap|coffee-rails)/d" -i Gemfile RUN bundle clean RUN rm -rf ./node_modules ./tmp/cache ./.git @@ -100,6 +100,11 @@ RUN adduser -s /bin/sh -G www-data -h /srv/http -D app # Convertirse en app para instalar USER app COPY --from=build --chown=app:www-data /home/app/checkout /srv/http +RUN rm -rf /srv/http/_sites /srv/http/_deploy +RUN ln -s data/_storage /srv/http/_storage +RUN ln -s data/_sites /srv/http/_sites +RUN ln -s data/_deploy /srv/http/_deploy +RUN ln -s data/_public /srv/http/_public # Volver a root para cerrar la compilación USER root @@ -110,9 +115,7 @@ RUN install -m 755 /srv/http/sync_assets.sh /usr/local/bin/sync_assets RUN install -m 640 -o root -g root /srv/http/monit.conf /etc/monit.d/sutty.conf # Mantener estos directorios! -VOLUME "/srv/http/_deploy" -VOLUME "/srv/http/_sites" -VOLUME "/srv/http/_public" +VOLUME "/srv/http/data" # El puerto de puma EXPOSE 3000 diff --git a/Gemfile b/Gemfile index f3d40206..0537bcd0 100644 --- a/Gemfile +++ b/Gemfile @@ -102,3 +102,4 @@ group :test do gem 'factory_bot_rails' gem 'timecop' end + diff --git a/config/storage.yml b/config/storage.yml index e21ac5cf..b35ed15d 100644 --- a/config/storage.yml +++ b/config/storage.yml @@ -1,14 +1,6 @@ -# XXX: Dirty hack -# -# Almacenamos los archivos dentro del directorio de sitios para poder -# hacer links duros. Si montamos en Docker los dos directorios por -# separado, aunque en el servidor estén los directorios dentro del mismo -# sistema de archivos, para Docker son dos distintos. -# -# Ver app/models/metadata_image.rb local: service: Disk - root: <%= Rails.root.join('_sites/_storage') %> + root: <%= Rails.root.join('_storage') %> test: service: Disk