Skip to content

Commit

Permalink
Docker containers
Browse files Browse the repository at this point in the history
  • Loading branch information
symkat committed Nov 29, 2021
1 parent 67c9577 commit 8dfe23f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .dex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@
desc: "Grab a shell to psql"
shell:
- docker exec -ti blogdb-db psql -U blogdb blogdb
- name: build
desc: "Build packages or containers."
children:
- name: mojo
desc: "Build the mojolicious base container."
shell:
- docker build . -t symkat/mojo -f .docker/mojo.dockerfile
- name: blogdb
desc: "Build the blogdb app container."
shell:
- docker build . -t symkat/blogdb -f .docker/blogdb.dockerfile
17 changes: 17 additions & 0 deletions .docker/blogdb.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM symkat/mojo:latest

USER root

ADD . /home/app/src
RUN chown -R app:app /home/app/src;

USER app

RUN eval $(perl -Mlocal::lib); \
cd /home/app/src/DB; \
dzil build; \
cpanm BlogDB-DB-*.tar.gz ; \
cd /home/app/src/Web; \
cpanm --installdeps .; \
cpanm --installdeps .; \
cpanm --installdeps .;
30 changes: 30 additions & 0 deletions .docker/mojo.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM debian:11

RUN apt-get update; \
apt-get install -y git build-essential libpq-dev libssl-dev libz-dev libexpat1-dev cpanminus liblocal-lib-perl \
postgresql-client postgresql-contrib postgresql python3-psycopg2; \
useradd -U -s /bin/bash -m app;

USER app
RUN eval $(perl -Mlocal::lib); \
echo 'eval $(perl -Mlocal::lib)' >> /home/app/.bashrc; \
cpanm Dist::Zilla Archive::Zip Minion Mojolicious::Plugin::XslateRenderer Mojolicious::Plugin::RenderFile Mojo::Pg \
DateTime::Format::Pg WebService::WsScreenshot LWP::UserAgent XML::RSS Test::Postgresql58 Test::More Test::Deep \
DBIx::Class::InflateColumn::Serializer DBIx::Class::Schema::Config DBIx::Class::DeploymentHandler Data::GUID \
MooseX::AttributeShortcuts MooseX::Getopt DBD::Pg; \
cpanm Dist::Zilla Archive::Zip Minion Mojolicious::Plugin::XslateRenderer Mojolicious::Plugin::RenderFile Mojo::Pg \
DateTime::Format::Pg WebService::WsScreenshot LWP::UserAgent XML::RSS Test::Postgresql58 Test::More Test::Deep \
DBIx::Class::InflateColumn::Serializer DBIx::Class::Schema::Config DBIx::Class::DeploymentHandler Data::GUID \
MooseX::AttributeShortcuts MooseX::Getopt DBD::Pg; \
cpanm Dist::Zilla Archive::Zip Minion Mojolicious::Plugin::XslateRenderer Mojolicious::Plugin::RenderFile Mojo::Pg \
DateTime::Format::Pg WebService::WsScreenshot LWP::UserAgent XML::RSS Test::Postgresql58 Test::More Test::Deep \
DBIx::Class::InflateColumn::Serializer DBIx::Class::Schema::Config DBIx::Class::DeploymentHandler Data::GUID \
MooseX::AttributeShortcuts MooseX::Getopt DBD::Pg; \
cpanm Dist::Zilla Archive::Zip Minion Mojolicious::Plugin::XslateRenderer Mojolicious::Plugin::RenderFile Mojo::Pg \
DateTime::Format::Pg WebService::WsScreenshot LWP::UserAgent XML::RSS Test::Postgresql58 Test::More Test::Deep \
DBIx::Class::InflateColumn::Serializer DBIx::Class::Schema::Config DBIx::Class::DeploymentHandler Data::GUID \
MooseX::AttributeShortcuts MooseX::Getopt DBD::Pg; \
cpanm Dist::Zilla Archive::Zip Minion Mojolicious::Plugin::XslateRenderer Mojolicious::Plugin::RenderFile Mojo::Pg \
DateTime::Format::Pg WebService::WsScreenshot LWP::UserAgent XML::RSS Test::Postgresql58 Test::More Test::Deep \
DBIx::Class::InflateColumn::Serializer DBIx::Class::Schema::Config DBIx::Class::DeploymentHandler Data::GUID \
MooseX::AttributeShortcuts MooseX::Getopt DBD::Pg;

0 comments on commit 8dfe23f

Please sign in to comment.