1
0
mirror of https://gitlab.com/depesz/explain.depesz.com.git synced 2026-06-19 22:15:11 +02:00

Update docker files to develop in non-native env

This commit is contained in:
Alexandre Felipe
2022-07-12 15:08:48 +01:00
parent 24ee7324cb
commit 9bca31ab04
3 changed files with 63 additions and 53 deletions
+29 -35
View File
@@ -1,35 +1,29 @@
FROM debian:buster
WORKDIR /explain
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y libmojolicious-perl \
libemail-sender-perl \
libdate-simple-perl \
libemail-valid-perl \
libxml-simple-perl \
libdbd-pg-perl \
libmodule-build-perl \
libyaml-perl \
libjson-perl \
libclone-perl \
libtest-deep-perl \
libtest-exception-perl \
libnumber-bytes-human-perl \
pgformatter \
curl \
build-essential
RUN curl -L cpanmin.us | perl - -n Mojolicious
RUN cpan install Pg::Explain
COPY lib/ ./lib/
COPY ext/ ./ext/
RUN sed -i s/Mail::Sender/Email::Sender/g lib/Explain/Plugin/MailSender.pm
COPY docker/explain.json explain.pl ./
COPY layout/ /layout/
COPY public/ ./public/
COPY templates/ ./templates
ENTRYPOINT ./explain.pl daemon
FROM debian:buster
WORKDIR /explain
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y libmojolicious-perl \
libemail-sender-perl \
libdate-simple-perl \
libemail-valid-perl \
libxml-simple-perl \
libdbd-pg-perl \
libmodule-build-perl \
libyaml-perl \
libjson-perl \
libclone-perl \
libtest-deep-perl \
libtest-exception-perl \
libnumber-bytes-human-perl \
pgformatter \
curl \
build-essential
RUN curl -L cpanmin.us | perl - -n Mojolicious
RUN cpan install Pg::Explain
COPY docker/explain.json explain.pl ./
ENTRYPOINT /explain/explain.pl daemon
+26 -18
View File
@@ -1,18 +1,26 @@
version: '3'
services:
web:
build:
context: ..
dockerfile: docker/Dockerfile
ports:
- "3000:3000"
depends_on:
- "db"
db:
image: "postgres:11.4"
environment:
POSTGRES_USER: explaind
POSTGRES_PASSWORD: explain
POSTGRES_DB: explain
volumes:
- ../sql:/docker-entrypoint-initdb.d
version: '3'
services:
web:
build:
context: ..
dockerfile: docker/Dockerfile
ports:
- "3000:3000"
depends_on:
- "db"
volumes:
# volumes instead of copying files. Don't use .. directly because we
# have to override explain.json
- ../lib:/explain/lib
- ../public:/explain/public
- ../layout:/explain/layout
- ../ext:/explain/ext
- ../templates:/explain/templates
db:
image: "postgres:11.4"
environment:
POSTGRES_USER: depesz_explain
POSTGRES_PASSWORD: depesz_explain
POSTGRES_DB: depesz_explain
volumes:
- ../sql:/docker-entrypoint-initdb.d