Open minibikini opened 7 years ago
Hello,
I haven't deployed a java app yet, but I am testing with one, so I hope I can help.
What does your boxfile look like? Are you using maven as a build tool? Are you packaging your application into a final fat .jar? Are you using any kind of framework, like http://sparkjava.com/?
I generate a fat jar file with maven and have it configured so I can run a server with nanobox run "mvn exec:exec@run-app"
. This is my standard boxfile:
run.config:
engine: java
engine.config:
runtime: oracle-jdk8
maven_version: '3.3'
deploy.config:
extra_steps:
- mvn clean package
web.site:
start: mvn exec:exec@run-app
data.queue:
image: nanobox/redis:3.2
config:
databases: 4
It might be faster / get more awareness if you ask around in the #java channel on slack.
Hi @bnunamak,
thanks for the reply!
I'm not a java dev, I was just trying to deploy Graylog which is a bunch of jar files.
Turns out I was missing these strings:
engine.config:
runtime: oracle-jdk8
gradle_version: '4.2'
So only
run.config:
engine: java
is not enough, and engine.config
is required. Not sure if it's bug or feature but it's undocumented.
Here is my boxfile for Graylog:
run.config:
engine: java
engine.config:
compile: 'echo "skip compile"'
runtime: oracle-jdk8
gradle_version: '4.2'
extra_path_dirs:
- dist/bin
data.elasticsearch:
image: nanobox/elasticsearch:5
data.mongodb:
image: nanobox/mongodb:3.4
data.storage:
image: nanobox/unfs
web.main:
start: graylogctl run
network_dirs:
data.storage:
- server
ports:
# Plaintext UDP
- udp:5555:5555
# nginx via Syslog UDP
- udp:12401:12401
- udp:12402:12402
deploy.config:
transform:
- bash ./setup.sh # generates config file from env vars
@minibikini Good catch. This is actually a use-case to allow users to disable the compile step so you can just use pre-built JARs that don't require compilation.
cc @sanderson
Hi,
Strangely, I can’t deploy java apps at all, here is what I get:
I have tried to
nanobox destroy
. I've even tried to deploy an empty java app, whereboxfile.yml
was the only file in the project/directory and it contained these two lines only:Nanobox Version 2.3.0-171031T1616 (80207fe) macos 10.13 High Sierra 😢