-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Created docker-compose configuration and tested in local to run as container #416
Changes from all commits
64909f6
7e77c8b
4b3716a
65dce37
002fa79
94a82e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build Docker image | ||
run: docker build -t ghcr.io/${{ github.repository }}/maybe:latest . | ||
|
||
- name: Push Docker image to GHCR | ||
run: | | ||
docker push ghcr.io/${{ github.repository }}/maybe:latest | ||
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. Does the |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ | |
# config.assume_ssl = true | ||
|
||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. | ||
config.force_ssl = true | ||
config.force_ssl = ENV.fetch("SSL_ENABLE", "true") == "true" | ||
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 suggest using either 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. You want me to have the variable 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.
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. If possible, can we stick with this solution? |
||
|
||
# Log to STDOUT by default | ||
config.logger = ActiveSupport::Logger.new(STDOUT) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
version: '3.8' | ||
|
||
services: | ||
postgres: | ||
image: postgres:16.1 | ||
container_name: postgres_db | ||
networks: ["maybe"] | ||
volumes: | ||
- maybe_postgresql:/var/lib/postgresql/data/ | ||
environment: | ||
POSTGRES_USER: maybe | ||
POSTGRES_PASSWORD: maybepass | ||
POSTGRES_DB: maybedb | ||
healthcheck: | ||
test: ['CMD-SHELL', 'pg_isready -U $${POSTGRES_USER}'] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 10 | ||
ports: ["5432:5432"] | ||
|
||
maybe: | ||
image: ghcr.io/maybe-finance/maybe:latest | ||
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. This |
||
container_name: maybe | ||
networks: ["maybe"] | ||
ports: ["3000:3000"] | ||
environment: | ||
SECRET_KEY_BASE: maybemaybehash | ||
MAYBE_DATABASE_PASSWORD: maybepass | ||
SSL_ENABLE: false | ||
RAILS_MAX_THREADS: 5 #optional | ||
DB_HOST: postgres | ||
POSTGRES_USER: maybe | ||
POSTGRES_DB: maybedb | ||
depends_on: | ||
- postgres | ||
volumes: | ||
maybe_postgresql: | ||
networks: | ||
maybe: |
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.
Wouldn't it suffice to only build and push on creating tags?