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

Docker container? #18

Closed
philipdistefano opened this issue May 8, 2022 · 9 comments
Closed

Docker container? #18

philipdistefano opened this issue May 8, 2022 · 9 comments

Comments

@philipdistefano
Copy link

This project looks sweet! Any plans for a docker container?

@igorski
Copy link
Owner

igorski commented Jul 6, 2022

Hi @philipdistefano thanks for the kind comment.

I hadn't planned a Docker container, maybe I'm overlooking your use case, but what benefit would the container provide ? Is it to run a self hosted BitMappery version ? BitMappery supports Service Workers and can be installed to the homescreen, which should make it a standalone, offline app.

But once more, maybe I'm overlooking the benefit you see ? :)

@philipdistefano
Copy link
Author

@igorski Yes, exactly! I have the project up and running, but docker would be much easier for most people, and then easier to maintain.

@Ange-Cesari
Copy link
Contributor

Ange-Cesari commented Apr 10, 2023

@philipdistefano
Hey,

I wrote a minimalist dockerfile to run bitmappery via docker container.

Simply follow these steps to generate the image yourself:

pre-requesite : docker & git

Step 1 : Go into a folder on your local machine and git clone the BitMappery project:

git clone https://github.com/igorski/bitmappery.git

Step 2 : Create a dockerfile at the root folder of the project and paste the following code :

# Written by Ange Cesari
# Use official Node.js based on Alpine
FROM node:16-alpine

# Install Yarn
RUN apk add --no-cache yarn

# Create dir for application
WORKDIR /usr/src/app

# Copy package.json
COPY package.json ./

# Install dependencies
RUN yarn install

# Copy the rest of the application code
COPY . .

# Expose the port the application will run on
EXPOSE 5173

# Run the application
CMD ["yarn", "dev", "--host", "0.0.0.0"]

Step 3 : Build the image :

docker build -t bitmappery .

Step 4 : Once i'ts built, run the container and bind the ports :

docker run -d -p 5173:5173 --name bitmappery-container bitmappery

Step 5 : Once the container is started, you should be able to reach http://localhost:5173

@igorski
Copy link
Owner

igorski commented Apr 11, 2023

Alright, following this again since there is more traction on the topic.

Thanks @Ange-Cesari for your example Dockerfile. We could add this to the repository. Maybe @philipdistefano you have some additional input ?

@philipdistefano
Copy link
Author

I haven't had a chance to test it yet, but it's rad to see this getting some traction! Will take a look later this week. Thanks @Ange-Cesari !

@philipdistefano
Copy link
Author

@Ange-Cesari @igorski Working successfully! Thanks for doing that!

@igorski
Copy link
Owner

igorski commented Apr 15, 2023

Thanks for the verification @philipdistefano

@Ange-Cesari I could add the Dockerfile to the repository with an addendum in the README on how to start it, or you could make a pull request containing the same, which I can then merge (if you care about having a contributor entry in the project :) ).

@Ange-Cesari
Copy link
Contributor

Ange-Cesari commented Apr 15, 2023

@igorski

I did the PR #28
I especially did not do a new branch so that you can merge easily, as no code has been edited. Obviously if code was edited/added/remove I would have done a new branch.

Hope it solves the issue and happy to contribute :).

PS : You should host on dockerhub.io the image, it could be use by some projects like easypanel. that allows people to use open source applications. (closed source for now but definitely doing things for the FOSS community.)

@igorski igorski closed this as completed Apr 16, 2023
@igorski
Copy link
Owner

igorski commented Apr 16, 2023

Awesome, thanks for the effort! I'll have a look at your other suggestions and see how this self hosting thing can be enriched in iterations to come :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants