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-compose and justfile #67

Merged
merged 4 commits into from
Dec 22, 2021
Merged

Docker-compose and justfile #67

merged 4 commits into from
Dec 22, 2021

Conversation

AetherUnbound
Copy link
Collaborator

@AetherUnbound AetherUnbound commented Dec 7, 2021

This PR prepares the project for a move from glitch onto our own infrastructure by standardizing its deployment using just and docker-compose. Fortunately this is a pretty simple app, so nothing too complex (unless we have to deal with static files, in which case I'll [REDACTED]). I've also upgraded to Python 3.9, because Glitch was the one holding us back and I want to use the walrus operator for stuff.

@mpuckett159
Copy link
Collaborator

Can we update the docs to include the just commands? I spent a bit trying to figure out why they didn't work anymore lol

@AetherUnbound
Copy link
Collaborator Author

Ah, great call - will do!

Copy link
Collaborator

@mpuckett159 mpuckett159 left a comment

Choose a reason for hiding this comment

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

Excellent, looks great, glad we're moving to just.

@AetherUnbound
Copy link
Collaborator Author

I'm actually going to cut the OpenOversight link changes off into a separate PR. We won't want to deploy that until we launch OO.

@AetherUnbound AetherUnbound changed the title Docker-compose, OpenOversight links Docker-compose and justfile Dec 22, 2021
Comment on lines +1 to +5
IS_PROD := env_var_or_default("IS_PROD", "")
COMPOSE_FILE := "-f docker-compose.yml " + if IS_PROD == "true" {""} else {"-f docker-compose.override.yml "}
DC := "docker-compose " + COMPOSE_FILE
RUN := DC + " run --rm app"
set dotenv-load := false
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like at this point just should just have a dc variant with all this built in 😂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seriously! I wish we could host a common justfile somewhere and import it here so we didn't have to keep repeating ourselves. I might end up doing a repo-sync similar to some other projects where the justfile is defined in one place and updated everywhere. I hate having to keep updating the dozen or so projects I work with!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Drat lol: casey/just#906

Comment on lines +14 to +17
### Build and run the app

Build the image with `just build` and run it using `just up`.
The server will be available at port `3030`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a small note about how to use IS_PROD? Is it just IS_PROD=true just up?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great idea!

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