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

feat: dockerize the app #105

Merged
merged 5 commits into from
Jun 23, 2021
Merged

feat: dockerize the app #105

merged 5 commits into from
Jun 23, 2021

Conversation

jackblk
Copy link
Contributor

@jackblk jackblk commented Jun 11, 2021

Hi,

I love your repo very much, it's a very good way to grab the freebie without any browser involved. It is much less flaky than browser way!

Also, I see that #33 has a "help wanted" tag, so here I help. This PR has no function change, only to implement a new way to use the package. Very minimal size, only 12MB bigger than node:16-alpine3.13 image.

$ docker images
REPOSITORY                                   TAG             IMAGE ID       CREATED          SIZE
ghcr.io/jackblk/epicgames-freebies-claimer   1.5.0           a604af3961e7   42 minutes ago   125MB
ghcr.io/jackblk/epicgames-freebies-claimer   latest          a604af3961e7   42 minutes ago   125MB
node                                         16-alpine3.13   48de5d16038c   7 days ago       113MB
image compressed (download) size full size
node:16-alpine3.13 39.15MB 113MB
epicgames-freebies-claimer 41.86MB 125MB

I also improve some other stuff:

  • change loop config to false, or container will run forever
  • support latest node on latest alpine, smallest size possible
  • fix format issue using eslint (default config)
  • added @babel/core since this is needed for eslint-parser

I've written a Guide on how to use the Docker image (and how to dev).

Any feedback will be helpful 🚀

jackblk added 3 commits June 11, 2021 22:35
* change loop config to false, or container will run forever
* support latest node on latest alpine, smallest size possible
* fix format issue using eslint (default config)
* added @babel/core since this is needed for eslint-parser
Build, lint, test on Windows/Linux with Node 12, 14, 16
* fix calling eslint via npx
* remove windows & node 14
Dockerfile Show resolved Hide resolved
@marchenm
Copy link

I suggest adding a docker-compose.yaml like:

version: '3.4'

services:
  epicgamesfreebiesclaimer:
    image: epicgamesfreebiesclaimer
    build: 
      context: .
      dockerfile: ./Dockerfile
    volumes:
      - ./device_auths.json:/app/device_auths.json:ro
    restart: unless-stopped

and keeping loop set to true so you can run this in the background with docker compose up -d

Also optionally if @Revadike would like, add the workflow to build the image using gh-actions and use github container registry to host it in this repo. Reference that image in docker-compose.yaml

@Revadike
Copy link
Owner

I am not using GitHub actions. GitHub will definitely ban this repo again if they got abused, so I rather stay away from it.

@jackblk
Copy link
Contributor Author

jackblk commented Jun 22, 2021

Thanks for the suggestion @marchenm. I'm not a fan of keeping the loop but that looks good, let's get the suggestion from @Revadike.

@Revadike
I will remove Github Actions workflow and maintain the image on my Dockerhub & Github Package so there's no risk for you or this repo. Do you any any other concern for merging this PR?

@Revadike
Copy link
Owner

Since I'm not testing this, I have to rely on third party reviewers. If they say its ok, I will merge it.

@Revadike
Copy link
Owner

Also, could you explain why should I merge this PR and not the other docker PR?

@marchenm
Copy link

This PR uses a newer version of node, works with the latest version of the codebase, and results in a smaller image size. It also doesn't add any additional scripts to the docker image.

@Revadike
Copy link
Owner

Alright, I will likely add this with the next update. Thanks everyone contributing to and reviewing this PR!

@Revadike Revadike merged commit daaf33d into Revadike:master Jun 23, 2021
@Revadike Revadike mentioned this pull request Jun 23, 2021
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.

4 participants