web-simple.dockerfile 675 B

123456789101112131415161718192021222324252627282930
  1. FROM tfb/nginx:latest
  2. FROM tfb/perl:latest
  3. COPY --from=0 /nginx /nginx
  4. ENV NGINX_HOME="/nginx"
  5. ENV PATH=/nginx/sbin:${PATH}
  6. WORKDIR /simple
  7. ENV PERL_CARTON_PATH=/simple/local
  8. ENV PERL5LIB=${PERL_CARTON_PATH}/lib/perl5
  9. ENV PATH=${PERL_CARTON_PATH}/bin:${PERL_HOME}/bin:${PATH}
  10. RUN cpanm --notest --no-man-page \
  11. Web::[email protected] \
  12. [email protected] \
  13. DBD::[email protected] \
  14. [email protected] \
  15. [email protected] \
  16. JSON::[email protected]
  17. ADD ./conf /simple/
  18. ADD ./app.pl /simple/
  19. ADD ./nginx.conf /simple/
  20. CMD nginx -c /simple/nginx.conf && \
  21. plackup -E production -s Starman --workers=$(nproc) \
  22. -l /tmp/perl-simple.sock -a /simple/app.pl