5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 03:56:22 +00:00

actualizar alpine y habilitar links duros

This commit is contained in:
f 2020-04-30 18:06:21 -03:00
parent 0da93a0d87
commit 5ffef95186
3 changed files with 10 additions and 14 deletions

View file

@ -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 <f@sutty.nl>"
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

View file

@ -102,3 +102,4 @@ group :test do
gem 'factory_bot_rails'
gem 'timecop'
end

View file

@ -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