Compare commits
1 Commits
trunk
...
0e3f8c2d8e
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e3f8c2d8e |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1 @@
|
||||
local
|
||||
node_modules
|
||||
assetpack.db
|
||||
|
||||
16
Dockerfile
16
Dockerfile
@@ -1,11 +1,3 @@
|
||||
FROM node:latest
|
||||
|
||||
WORKDIR /opt/mojo_app/
|
||||
|
||||
COPY mojo_app/package.json .
|
||||
COPY mojo_app/package-lock.json .
|
||||
RUN npm install
|
||||
|
||||
FROM perl:latest
|
||||
|
||||
WORKDIR /opt/app/
|
||||
@@ -14,11 +6,11 @@ COPY cpanfile .
|
||||
COPY cpanfile.snapshot .
|
||||
COPY mojo_app ./mojo_app/
|
||||
|
||||
RUN cpanm -nv Carton && carton install
|
||||
|
||||
WORKDIR /opt/app/mojo_app/
|
||||
COPY --from=0 /opt/mojo_app/ .
|
||||
RUN cpanm Carton && carton install
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
WORKDIR /opt/app/mojo_app/
|
||||
|
||||
ENTRYPOINT ["carton", "exec", "--", "morbo", "script/mojo_app"]
|
||||
|
||||
|
||||
15
README.md
15
README.md
@@ -16,21 +16,8 @@ Visit `localhost:3000` with web browser.
|
||||
|
||||
## serve app with local changes
|
||||
|
||||
### install Mojolicious dependencies
|
||||
|
||||
$ docker run --rm -v $PWD:/opt/app --entrypoint carton mojo_app install
|
||||
|
||||
### install Node packages
|
||||
|
||||
$ docker run --rm --init -w /opt/mojo_app -v $PWD/mojo_app:/opt/mojo_app node npm install
|
||||
|
||||
### start the server
|
||||
|
||||
$ docker run --rm -v $PWD:/opt/app -p 3000:3000 mojo_app
|
||||
$ docker run --rm -it -p 3000:3000 -v $PWD:/opt/app mojo_app
|
||||
|
||||
Visit `localhost:3000` with web browser. Changes should load when you reload
|
||||
the page, without having to restart the server.
|
||||
|
||||
## run tests
|
||||
|
||||
$ docker run --rm -t -v $PWD:/opt/app --entrypoint carton mojo_app exec -- prove -lv t
|
||||
|
||||
3
cpanfile
3
cpanfile
@@ -1,2 +1 @@
|
||||
requires 'Mojolicious' => '9.48';
|
||||
requires 'Mojolicious::Plugin::AssetPack' => '2.15';
|
||||
requires 'Mojolicious' => '9.48',
|
||||
|
||||
@@ -1,21 +1,5 @@
|
||||
# carton snapshot format: version 1.0
|
||||
DISTRIBUTIONS
|
||||
File-Which-1.27
|
||||
pathname: P/PL/PLICEASE/File-Which-1.27.tar.gz
|
||||
provides:
|
||||
File::Which 1.27
|
||||
requirements:
|
||||
ExtUtils::MakeMaker 0
|
||||
base 0
|
||||
perl 5.006
|
||||
IPC-Run3-0.049
|
||||
pathname: R/RJ/RJBS/IPC-Run3-0.049.tar.gz
|
||||
provides:
|
||||
IPC::Run3 0.049
|
||||
requirements:
|
||||
ExtUtils::MakeMaker 0
|
||||
Test::More 0.31
|
||||
Time::HiRes 0
|
||||
Mojolicious-9.48
|
||||
pathname: S/SR/SRI/Mojolicious-9.48.tar.gz
|
||||
provides:
|
||||
@@ -136,32 +120,3 @@ DISTRIBUTIONS
|
||||
IO::Socket::IP 0.37
|
||||
Sub::Util 1.41
|
||||
perl 5.016
|
||||
Mojolicious-Plugin-AssetPack-2.15
|
||||
pathname: S/SR/SRI/Mojolicious-Plugin-AssetPack-2.15.tar.gz
|
||||
provides:
|
||||
Mojolicious::Plugin::AssetPack 2.15
|
||||
Mojolicious::Plugin::AssetPack::Asset undef
|
||||
Mojolicious::Plugin::AssetPack::Asset::Null undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::CoffeeScript undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Combine undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Css undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Favicon undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Fetch undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::JavaScript undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Jpeg undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Less undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Png undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Riotjs undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::RollupJs undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Sass undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::TypeScript undef
|
||||
Mojolicious::Plugin::AssetPack::Pipe::Vuejs undef
|
||||
Mojolicious::Plugin::AssetPack::Store undef
|
||||
Mojolicious::Plugin::AssetPack::Util undef
|
||||
Mojolicious::Plugin::AssetPack::Util::_chdir undef
|
||||
requirements:
|
||||
ExtUtils::MakeMaker 0
|
||||
File::Which 1.21
|
||||
IPC::Run3 0.048
|
||||
Mojolicious 9.34
|
||||
|
||||
1
mojo_app/assets/materialize.css
vendored
1
mojo_app/assets/materialize.css
vendored
@@ -1 +0,0 @@
|
||||
../node_modules/materialize-css/dist/css/materialize.css
|
||||
@@ -10,9 +10,6 @@ sub startup ($self) {
|
||||
# Configure the application
|
||||
$self->secrets($config->{secrets});
|
||||
|
||||
$self->plugin(AssetPack => {pipes => [qw(Css)]});
|
||||
$self->asset->process("app.css" => ("materialize.css"));
|
||||
|
||||
# Router
|
||||
my $r = $self->routes;
|
||||
|
||||
|
||||
18
mojo_app/package-lock.json
generated
18
mojo_app/package-lock.json
generated
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"name": "mojo_app",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"materialize-css": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/materialize-css": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/materialize-css/-/materialize-css-1.0.0.tgz",
|
||||
"integrity": "sha512-4/oecXl8y/1i8RDZvyvwAICyqwNoKU4or5uf8uoAd74k76KzZ0Llym4zhJ5lLNUskcqjO0AuMcvNyDkpz8Z6zw==",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"materialize-css": "^1.0.0"
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= title %></title>
|
||||
%= asset "app.css"
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<%= content %>
|
||||
</body>
|
||||
<head><title><%= title %></title></head>
|
||||
<body><%= content %></body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user