docker: HEALTHCHECK via /healthz, freeze bundle to lockfile
This commit is contained in:
parent
afde73e772
commit
d1d82d90ff
1 changed files with 5 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ ENV GEM_HOME=/app/bundle
|
||||||
ENV PATH="${GEM_HOME}/bin:${PATH}"
|
ENV PATH="${GEM_HOME}/bin:${PATH}"
|
||||||
|
|
||||||
COPY --chown=asxpio Gemfile Gemfile.lock* ./
|
COPY --chown=asxpio Gemfile Gemfile.lock* ./
|
||||||
|
ENV BUNDLE_FROZEN=true
|
||||||
RUN bundle install --without development:test
|
RUN bundle install --without development:test
|
||||||
|
|
||||||
COPY --chown=asxpio . .
|
COPY --chown=asxpio . .
|
||||||
|
|
@ -24,4 +25,8 @@ ENV PUMA_THREADS="4:16"
|
||||||
ENV RACK_ENV=production
|
ENV RACK_ENV=production
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
|
# Slim image has no curl; ruby is right there.
|
||||||
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
||||||
|
CMD ruby -rnet/http -e 'port = ENV.fetch("PUMA_PORT", "3000"); exit(Net::HTTP.get_response(URI("http://127.0.0.1:#{port}/healthz")).code == "200" ? 0 : 1)'
|
||||||
|
|
||||||
CMD ["sh", "-c", "exec puma -b tcp://0.0.0.0:${PUMA_PORT} -t ${PUMA_THREADS} --preload"]
|
CMD ["sh", "-c", "exec puma -b tcp://0.0.0.0:${PUMA_PORT} -t ${PUMA_THREADS} --preload"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue