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 / docker-compose build + semi-automatic deployment #22

Merged
merged 17 commits into from
Feb 21, 2022

Conversation

lfoppiano
Copy link
Owner

@lfoppiano lfoppiano commented Feb 18, 2022

...follow up of #20, it solves #18

Docker image

Build

docker build -t lfoppiano/supercon2:1.2 --file Dockerfile .

Run

docker run -rm -p 8080 -v ./supercon2/config-docker.yaml:/opt/service/supercon2/config.yaml:ro lfoppiano/supercon2:1.2

For connecting to mongodb is possible to connect directly to the mongodb IP (to be specified in config-docker.yaml), if this is not possible then it's recommended to use docker-compose.

Docker compose

The docker compose is going to mount the volume resources/mongo as /data/db in the container. And mapping the mongodb container with port 27018 (to avoid conflicts with the default mongodb port).

The configuration file supercon2/config-docker.yaml is also mapped in the supercon2 container /opt/service/supercon2/config.yaml

@lfoppiano lfoppiano added the enhancement New feature or request label Feb 18, 2022
@lfoppiano lfoppiano added this to the flagging workflow milestone Feb 18, 2022
@lfoppiano
Copy link
Owner Author

@t29mato please notice that the CodeQL will not work until we make this repository as public

Copy link
Collaborator

@t29mato t29mato left a comment

Choose a reason for hiding this comment

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

Pulling supercon2 (lfoppiano/supercon2:1.2)...
ERROR: pull access denied for lfoppiano/supercon2, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

I think I need a permission

@lfoppiano
Copy link
Owner Author

Ah sorry, I didn't push it yet over there... so you should do that locally for the time being ...

@t29mato
Copy link
Collaborator

t29mato commented Feb 18, 2022 via email

@t29mato
Copy link
Collaborator

t29mato commented Feb 18, 2022

How did you mongorestore on docker-compose?
I feel it's a bit of a pain., so I'm thinking of running MongoDB on my local machine

@lfoppiano
Copy link
Owner Author

after you docker compose up, you can connect directly to the mongodb using the port localhost:27018. In the same way you can run mongorestore using that address. Have you tried like that?

@t29mato
Copy link
Collaborator

t29mato commented Feb 20, 2022

Exactly! I could import them as you said

Copy link
Collaborator

@t29mato t29mato left a comment

Choose a reason for hiding this comment

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

I left one comment, but I don't think it's a problem.

supercon2/__main__.py Show resolved Hide resolved
@lfoppiano lfoppiano merged commit 23e5cfb into develop Feb 21, 2022
@lfoppiano lfoppiano deleted the feature/add-docker-build branch March 2, 2022 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants