Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker files, update README #171

Merged
merged 5 commits into from
Jun 11, 2024
Merged

Add Docker files, update README #171

merged 5 commits into from
Jun 11, 2024

Conversation

Phu2
Copy link
Contributor

@Phu2 Phu2 commented Jun 7, 2024

This PR adds the ability to setup playground with docker. Both in development and production mode.

@Phu2 Phu2 self-assigned this Jun 7, 2024
@Phu2
Copy link
Contributor Author

Phu2 commented Jun 7, 2024

@fsteeg Please try out the development mode.

@Phu2 Phu2 requested a review from fsteeg June 7, 2024 12:33
@fsteeg
Copy link
Member

fsteeg commented Jun 7, 2024

Added port mappings for lein watch (runs on 8280, uses something on 9630) and updated README with links to the local server. With this, for me the playground starts in dev mode and can be used to run workflows. When I edit code however, it's not reflected in the running instance (which plain lein watch should do).

(You did not ask me to review it, but I still tried prod mode, but that is not working for me: logs look good, but can't connect on port 3000.)

Phu2 added 2 commits June 10, 2024 10:47
editing files on the host will be reflected in the running container
in order to isolate dev and prod environments
@Phu2
Copy link
Contributor Author

Phu2 commented Jun 10, 2024

Added port mappings for lein watch (runs on 8280, uses something on 9630) and updated README with links to the local server. With this, for me the playground starts in dev mode and can be used to run workflows.

Thank you! ❤️

When I edit code however, it's not reflected in the running instance (which plain lein watch should do).

Because i forgot to add a bind mount from the project folder on the host to the container, caught up with 8a8b9eb

(You did not ask me to review it, but I still tried prod mode, but that is not working for me: logs look good, but can't connect on port 3000.)

Some docker caching is getting in the way, i think. When starting a second mode, you have to use the flag --force-recreate, eg. docker compose up --force-recreate, forcing Docker to create the container anew.
Hopefully, by adding different project names and environments respectively we have a cleaner solution. See this commit a925d77
Now you should be able to start both modes independently and in parallel. Check running containers with docker ps.

@fsteeg
Copy link
Member

fsteeg commented Jun 10, 2024

Picking up code changes in dev mode now works! 👍

Prod mode also starts, I can access and run examples in general. However, I get a java.security.AccessControlException: access denied ("java.io.FilePermission" "/opt/.project" "read") when running http://localhost:3000/?example=How+to+use+the+Playground

permissions set in java policy template are tailored
to these paths under the user home
@Phu2
Copy link
Contributor Author

Phu2 commented Jun 10, 2024

Prod mode also starts, I can access and run examples in general. However, I get a java.security.AccessControlException: access denied ("java.io.FilePermission" "/opt/.project" "read") when running http://localhost:3000/?example=How+to+use+the+Playground

Thanks! Changed installation directory from /opt to /home/playground in order to match permissions set in the provided java policy template. We are using this template as is without any modification. See adbc52f

Please execute docker compose -f docker-compose-dev.yml up --build --force-recreate for Docker to rebuild the underlying image. Otherwise Docker won't pick up changes made in the Dockerfile. (Look for lines beginning with => CACHED in the output of the docker compose command)

You also may want to cleanup unused images and reduce disk usage. Check: docker image ls and delete all unused images: docker image prune -a.

Copy link
Member

@fsteeg fsteeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! The example now works, both in dev and prod mode.

@Phu2 Phu2 merged commit adbc52f into main Jun 11, 2024
2 checks passed
@Phu2 Phu2 deleted the dockerised-playground branch June 11, 2024 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants