简体   繁体   中英

How to customize Payara image in docker-compose

I'm actually deploying an application with Payara and Docker and I want to create my cluster with a NGINX Reverse Proxy, I want to overwrite the default password from my DockerFile and execute a command that will help me to create my cluster after launching the DAS Server.

For my first point, I want to know if I can overwrite the password file and how ?

For the second point, I want to know how can I use POSTBOOT_COMMANDS to create a cluster after launching my DAS

If you take a look at the Payara Dockerfile over here:

https://hub.docker.com/r/payara/server-full/~/dockerfile/

You will see that it sets environment variables ADMIN_USER and ADMIN_PASSWORD. Just overwrite those with what you'd like to use instead.

On the second question - from the documentation for Payara Docker you will see the following:

It's possible to run a custom set of asadmin commands by specifying the POSTBOOT_COMMANDS environment variable to point to the abslute path of the custom post boot command file.

So you just need to set the POSTBOOT_COMMANDS environment variable.

Example Docker-Compose file:

version: '3'
services:
  payara:
    image: "payara/server-full"
    environment:
      - ADMIN_USER=admin
      - ADMIN_PASSWORD=newpass
      - POSTBOOT_COMMANDS=./path/to/file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM