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

[Development/GettingStarted] Docker compose workflow #738

Merged

Conversation

robacarp
Copy link
Contributor

@robacarp robacarp commented Mar 4, 2022

This is a series of contributions aimed at making getting started writing a Lucky app easier.

This allows an app generated with lucky_cli to play well in a docker compose based development environment. There are some benefits and drawbacks to this, but primarily it means that crystal, libssl, postgres, and other libraries/tools don't need to be installed in order to get started.

This does not provide a Dockerfile for production use, which would be very different from a development environment. After this is merged, I or someone else can tackle that, perhaps with a lot of inspiration from Lucky Jumpstart or my own lucky template.

In order to get started with this, a generated app need only run docker compose up or docker-compose up. It will download images, create the database, install npm modules, install shard dependencies, and even migrate the database (just on the first boot).

@@ -0,0 +1,36 @@
FROM crystallang/crystal:1.1.1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This needs to be updated, but later versions of the crystal dockerfile don't play well with my computer yet. If someone is willing to test this on an AMD64 architecture with this line updated to 1.3.2, I'll be happy to update it.

Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

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

I love the direction! I just had a few questions, but no real changes that I can see. Thanks for putting this together 🚀

#
# Use this script to test if a given TCP host/port are available

WAITFORIT_cmdname=${0##*/}
Copy link
Member

Choose a reason for hiding this comment

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

waiting

Comment on lines +21 to +24
RUN wget https://github.com/DarthSim/overmind/releases/download/v2.2.2/overmind-v2.2.2-linux-amd64.gz && \
gunzip overmind-v2.2.2-linux-amd64.gz && \
mv overmind-v2.2.2-linux-amd64 /usr/bin/overmind && \
chmod +x /usr/bin/overmind
Copy link
Member

Choose a reason for hiding this comment

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

Should we be using Nox for this? It comes with Lucky CLI which gets installed in the next run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. This provides overmind in the system, but if lucky-cli doesn't need it, it won't hurt anything. I needed this because I developed it against lucky-cli release rather than main.

Copy link
Member

Choose a reason for hiding this comment

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

Ah. I forgot Nox integration hasn't been released yet. Yeah, the next release won't need a process runner!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this will ship with Nox, when the cli is revised, I'm happy to pull it now or leave it in. I don't think it hurts and it might help someone get a compose going for an app that doesn't yet have the newest version of lucky on their system.

src/web_app_skeleton/docker/dev_entrypoint.sh Show resolved Hide resolved
src/web_app_skeleton/docker/dev_entrypoint.sh Outdated Show resolved Hide resolved
robacarp added 3 commits March 4, 2022 14:35
when the container crashes, this file doesn't get cleaned up and it won't boot again
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.

3 participants