-
Notifications
You must be signed in to change notification settings - Fork 151
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
Adding Docker Support #319
Open
bbdoc
wants to merge
2
commits into
Noctem:develop
Choose a base branch
from
bbdoc:develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Basic docker image for Monocle | ||
# Usage: | ||
# docker build -t Monocle | ||
# docker run -d --name Monocle -P Monocle | ||
|
||
FROM python:3.6 | ||
|
||
# Working directory for the application | ||
WORKDIR /usr/src/app | ||
|
||
# Set Entrypoint with hard-coded options | ||
ENTRYPOINT ["python3", "./scan.py"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to suggest to change to |
||
|
||
# Install required system packages | ||
RUN apt-get update && apt-get install -y --no-install-recommends libgeos-dev | ||
|
||
COPY requirements.txt /usr/src/app/ | ||
|
||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
|
||
# Copy everything to the working directory (Python files, templates, config) in one go. | ||
COPY . /usr/src/app/ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python:3.6-alpine3.6
could be worth trying to reduce the sizeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try to build it with alpine but was running into some missing requirements to install monocle packages so fell back on the full python:3.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean with providing a config.py / accounts.csv. It doesn't need to be part of the image, you can easily have those files in a local folder and user docker run -v option in order to share those files between your local filesystem and docker container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also try with :alpine, but I had a mistake with the pogeo requirement.
This is my current working docker file :
And my
supervisord.conf
:And my docker CMD :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the accounts.pickle could be a thing, too
as if you don't have your phone IDs in the accounts.csv they would be generated everytime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can add it in the description but I guess people using docker know they need to provide a persistent working directory on the local filesystem if they want anything persistent... so indeed I also pass a -v option with a working directory for pickles, logs, ... That's more something we would need to describe in a wiki than in the dockerfile itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are a lot of people who know what docker is and may get it started, but acually have no idea of what they are doing ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this gets committed, I'll update the wiki with some recommandations and examples on how to launch Monocle inside a docker container... guess they are other things to talk about (e.g. creating a docker network and run a db inside a docker with persistency on local filesystem) so better tackle all those stuff on the wiki for people who would like to start with Docker ;-)