FROM unit:1.31.1-perl5.38 # Alternatively, you can download the base image from AWS ECR: # FROM public.ecr.aws/nginx/unit:1.31.1-perl5.38 # port used by the listener in config.json EXPOSE 8080 #application setup RUN mkdir /www/ && echo ' \ my $app = sub { \ return [ \ "200", \ [ "Content-Type" => "text/plain" ], \ [ "Hello, Perl on Unit!" ], \ ] \ }; \ ' > /www/app.psgi \ # prepare the app config for Unit && echo '{ \ "listeners": { \ "*:8080": { \ "pass": "applications/perl_app" \ } \ }, \ "applications": { \ "perl_app": { \ "type": "perl", \ "working_directory": "/www/", \ "script": "/www/app.psgi" \ } \ } \ }' > /docker-entrypoint.d/config.json