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

Added Docker build workflow #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChaosMarc
Copy link

@ChaosMarc ChaosMarc commented Aug 10, 2023

Thank you very much for this awsome app! My wife and I are constantly battling against each other for a few days now :)

As I'm about to host my own server to be more flexible and wanted to run it via Docker, I've decided to automate the Docker build process. This PR will automatically create and publish a Dockerimage for every github release you create. It will publish the two docker tags "latest" and "<the git tag name the release is based on>".

If you choose to integrate the PR, all you have to do before creating the next release is:

  1. Create an account at https://hub.docker.com/signup if you you haven't already
  2. Create a new access token with read/write/delete permissions at https://hub.docker.com/settings/security if you you haven't already
  3. Create a new repository called "lightblocks" (or whatever you want to call it, but then you have to update .github/workflows/release_server.yml:45 accordingly) at https://hub.docker.com/repository/create
  4. Add two Github Secrets DOCKERHUB_USERNAME and DOCKERHUB_TOKEN with the data from step 1 and 2 at https://github.com/MrStahlfelge/lightblocks/settings/secrets/actions

Kind regards
Marc

@MrStahlfelge
Copy link
Owner

Hi and thanks for the contribution! Myself, I use dokku on docker and push the repository to the application added on dokku to run the server. I am not familiar with using docker in another way. Do you already use it the way it is configured in the prepared dockerfile?

@ChaosMarc
Copy link
Author

ChaosMarc commented Aug 17, 2023

Hey, sorry for the delay. Couldn't leave the bed for a few days as the nice little virus starting with a "C" nobody seems to be talking about anymore hit me pretty hard.

Yes, I'm already using the built image on my server. This is my docker compose config:

version: '2'

services:
  lightblocks:
    image: chaosmarc/lightblocks
    container_name: lightblocks
    volumes:
      - /opt/config/lightblocks/server.xml:/server.xml
    ports:
      - "8887:8887"
    restart: unless-stopped 

If I added the port to the Dockerfile I probably wouldn't have to define it in my docker compose config. I will test that either today or tomorrow depending on how my health progresses.

Afterthought: Note how I have to mount the server.xml file to / instead it /app were the jar file resides. I think this could be fixed by added /app to the class path. I will check that too.

@ChaosMarc
Copy link
Author

Ok. I've fixed the app searching for server.xml in / and added the port exposure to the Dockerfile. From my side there isn't anything left I would change

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