mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-14 23:01:41 +00:00
contenedor
This commit is contained in:
parent
45b82f85b6
commit
3892d12cbc
2 changed files with 9 additions and 9 deletions
15
Dockerfile
15
Dockerfile
|
@ -2,7 +2,7 @@
|
|||
# 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
|
||||
# un clone/pull limpio.
|
||||
FROM alpine:3.9 as build
|
||||
FROM alpine:3.10 as build
|
||||
MAINTAINER "f <f@sutty.nl>"
|
||||
|
||||
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
|
||||
RUN addgroup -g 82 -S www-data
|
||||
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
|
||||
|
||||
# Empezamos con la usuaria app
|
||||
|
@ -47,8 +47,8 @@ RUN cd .. && git clone sutty checkout
|
|||
|
||||
WORKDIR /home/app/checkout
|
||||
# Traer las gemas:
|
||||
RUN mv ../web/vendor ./vendor
|
||||
RUN mv ../web/.bundle ./.bundle
|
||||
RUN mv ../sutty/vendor ./vendor
|
||||
RUN mv ../sutty/.bundle ./.bundle
|
||||
|
||||
# Instalar secretos
|
||||
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
|
||||
|
||||
# Sincronizar los assets a un directorio compartido
|
||||
COPY ./sync_assets.sh /usr/local/bin/sync_assets
|
||||
RUN chmod 755 /usr/local/bin/sync_assets
|
||||
# Instalar la configuración de monit y comprobarla
|
||||
RUN install -m 640 -o root -g root ./monit.conf /etc/monit.d/sutty.conf
|
||||
RUN install -m 755 /srv/http/sync_assets.sh /usr/local/bin/sync_assets
|
||||
# Instalar la configuración de monit
|
||||
RUN install -m 640 -o root -g root /srv/http/monit.conf /etc/monit.d/sutty.conf
|
||||
|
||||
# Mantener estos directorios!
|
||||
VOLUME "/srv/http/_deploy"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
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'"
|
||||
|
||||
check program sync_assets
|
||||
|
|
Loading…
Reference in a new issue