contenedor

This commit is contained in:
f 2019-11-18 14:10:05 -03:00
parent 45b82f85b6
commit 3892d12cbc
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 9 additions and 9 deletions

View file

@ -2,7 +2,7 @@
# el mismo repositorio de trabajo. Cuando tengamos CI/CD algunas cosas # el mismo repositorio de trabajo. Cuando tengamos CI/CD algunas cosas
# como el tarball van a tener que cambiar porque ya vamos a haber hecho # como el tarball van a tener que cambiar porque ya vamos a haber hecho
# un clone/pull limpio. # un clone/pull limpio.
FROM alpine:3.9 as build FROM alpine:3.10 as build
MAINTAINER "f <f@sutty.nl>" MAINTAINER "f <f@sutty.nl>"
ARG RAILS_MASTER_KEY ARG RAILS_MASTER_KEY
@ -24,7 +24,7 @@ RUN cd /usr/lib/ruby/2.5.0 && patch -Np 0 -i /tmp/rubygems-platform-musl.patch
# Agregar el usuario # Agregar el usuario
RUN addgroup -g 82 -S www-data RUN addgroup -g 82 -S www-data
RUN adduser -s /bin/sh -G www-data -h /home/app -D app RUN adduser -s /bin/sh -G www-data -h /home/app -D app
RUN install -dm750 -o app -g www-data /home/app/web RUN install -dm750 -o app -g www-data /home/app/sutty
RUN gem install --no-document bundler:2.0.2 RUN gem install --no-document bundler:2.0.2
# Empezamos con la usuaria app # Empezamos con la usuaria app
@ -47,8 +47,8 @@ RUN cd .. && git clone sutty checkout
WORKDIR /home/app/checkout WORKDIR /home/app/checkout
# Traer las gemas: # Traer las gemas:
RUN mv ../web/vendor ./vendor RUN mv ../sutty/vendor ./vendor
RUN mv ../web/.bundle ./.bundle RUN mv ../sutty/.bundle ./.bundle
# Instalar secretos # Instalar secretos
COPY --chown=app:root ./config/credentials.yml.enc ./config/ COPY --chown=app:root ./config/credentials.yml.enc ./config/
@ -99,10 +99,9 @@ COPY --from=build --chown=app:www-data /home/app/checkout /srv/http
USER root USER root
# Sincronizar los assets a un directorio compartido # Sincronizar los assets a un directorio compartido
COPY ./sync_assets.sh /usr/local/bin/sync_assets RUN install -m 755 /srv/http/sync_assets.sh /usr/local/bin/sync_assets
RUN chmod 755 /usr/local/bin/sync_assets # Instalar la configuración de monit
# Instalar la configuración de monit y comprobarla RUN install -m 640 -o root -g root /srv/http/monit.conf /etc/monit.d/sutty.conf
RUN install -m 640 -o root -g root ./monit.conf /etc/monit.d/sutty.conf
# Mantener estos directorios! # Mantener estos directorios!
VOLUME "/srv/http/_deploy" VOLUME "/srv/http/_deploy"

View file

@ -1,5 +1,6 @@
check process sutty with pidfile /srv/http/tmp/puma.pid check process sutty with pidfile /srv/http/tmp/puma.pid
start program = "/bin/sh -c 'cd /srv/http && foreman start migrate && foreman start sutty'" as uid app start program = "/bin/sh -c 'cd /srv/http && foreman start migrate && foreman start sutty'"
as uid "app" and gid "www-data"
stop program = "/bin/sh -c 'cat /srv/http/tmp/puma.pid | xargs kill'" stop program = "/bin/sh -c 'cat /srv/http/tmp/puma.pid | xargs kill'"
check program sync_assets check program sync_assets