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 setup #1428

Draft
wants to merge 39 commits into
base: main
Choose a base branch
from
Draft

Docker setup #1428

wants to merge 39 commits into from

Conversation

efstajas
Copy link
Contributor

@efstajas efstajas commented Jan 23, 2025

PR for improved Docker setup.

Changes:

  • Adds a single Dockerfile that can be used to deploy a production build on Railway, build a generic production image, and building an image for development that can run the dev server
  • Adds a single docker-compose.yml file that (for now) spins up a Redis and dev container of the app
  • Most environment variables apart from a few absolutely necessary ones are now optional during development
    • getOptionalEnvVar utils now allow specifying whether the variable is required in production
    • getOptionalEnvVar will now warn about a variable that is required in prod but not def missing, including clear logs about what functionality will be missing / not work properly given the lack of any particular variable
  • Changes to building GQL types
    • New npm run gql:generate-schema command will only fetch schema from remote GQL server using GQL_URL and GQL_ACCESS_TOKEN, and create a (gitignored) schema.graphql file in root dir
    • New npm run gql:build-types command will build GQL types based on schema.graphql file.
    • New npm run gql:build command combines the two above commands into one.
    • Building the Dockerfile (by default) now expects schema.graphql file being present in root dir. This allows building a production image including GQL types without leaking GQL_ACCESS_TOKEN into the built image.
    • Still, passing GQL_URL and GQL_ACCESS_TOKEN directly into the image build is possible so that Railway can build properly.

Todo:

  • Add GitHub Action that builds app docker image and publishes it to Docker registry
  • Dockerize all other parts of the stack by creating Dockerfiles that publish to Docker registry
  • Add all other parts of the stack to app's docker-compose for development
  • Update .env.template
  • Update DEVELOPMENT.md documentation

Copy link

railway-app bot commented Jan 23, 2025

🚅 Deployed to the app-pr-1428 environment in Drips App

Service Status Web Updated (UTC)
[Base PR] App ✅ Success (View Logs) Web Jan 28, 2025 at 12:36 pm

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.

1 participant