Skip to content

Commit

Permalink
Keep .env file and remove .env.example
Browse files Browse the repository at this point in the history
  • Loading branch information
zakariaf committed Nov 20, 2022
1 parent 915133e commit f58025d
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 94 deletions.
63 changes: 44 additions & 19 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
.git/
log/*
!log/.keep
node_modules
public/vite/*
public/vite-test/*
storage/*
!storage/.keep
tmp/*
!tmp/.keep

.bundle
.byebug_history
.dockerignore
.env*
!.env.example
!.env.test
config/master.key
yarn-error.log

# Ignore bundler config.
/.bundle

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
npm-debug.log*
yarn-debug.log*
.yarn-integrity
yarn-error.log*

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/
!/tmp/storage/.keep

/public/assets

# Ignore master key for decrypting credentials and more.
/config/master.key

/app/assets/builds/*
!/app/assets/builds/.keep

# Ignore SampleCov files
/coverage/*

# Vite Ruby
/public/vite*
node_modules
# Vite uses dotenv and suggests to ignore local-only env files. See
# https://vitejs.dev/guide/env-and-mode.html#env-files
*.local

# Ignore uncategorized files
.DS_Store
66 changes: 27 additions & 39 deletions .env.example → .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@ export COMPOSE_PROJECT_NAME=baseapp
# In development we want all services to start but in production you don't
# need the asset watchers to run since assets get built into the image.
#
# You can even choose not to run postgres and redis in prod if you plan to use
# managed cloud services. Everything "just works", even optional depends_on!
export RAILS_ENV=development
export NODE_ENV=development
export COMPOSE_PROFILES=postgres,redis,assets,web,worker,cable
#export RAILS_ENV=production
#export NODE_ENV=production
#export COMPOSE_PROFILES=postgres,redis,web,worker,cable

# What volume path should be used? In dev we want to volume mount everything
# so that we can develop our code without rebuilding our Docker images.
export DOCKER_WEB_VOLUME=.:/app
#export DOCKER_WEB_VOLUME=./public:/app/public
export RAILS_ENV=production
export NODE_ENV=production
export COMPOSE_PROFILES=postgres,redis,web,worker,cable

# Should Docker restart your containers if they go down in unexpected ways?
#export DOCKER_RESTART_POLICY=unless-stopped
export DOCKER_RESTART_POLICY=no
export DOCKER_RESTART_POLICY=unless-stopped
# export DOCKER_RESTART_POLICY=no

# What ip:port should be published back to the Docker host for the app server?
# If you're using Docker Toolbox or a custom VM you can't use 127.0.0.1. This
Expand All @@ -35,12 +25,12 @@ export DOCKER_RESTART_POLICY=no
#
# Use the default in production to avoid having puma directly accessible to
# the internet since it'll very likely be behind nginx or a load balancer.
#export DOCKER_WEB_PORT_FORWARD=127.0.0.1:3000
export DOCKER_WEB_PORT_FORWARD=3000
export DOCKER_WEB_PORT_FORWARD=127.0.0.1:3000
# export DOCKER_WEB_PORT_FORWARD=3000

# This is the same as above except for Action Cable.
#export DOCKER_CABLE_PORT_FORWARD=127.0.0.1:28080
export DOCKER_CABLE_PORT_FORWARD=28080
export DOCKER_CABLE_PORT_FORWARD=127.0.0.1:28080
# export DOCKER_CABLE_PORT_FORWARD=28080

# What CPU and memory constraints will be added to your services? When left at
# 0 they will happily use as much as needed.
Expand All @@ -61,36 +51,34 @@ export SECRET_KEY_BASE=insecure-key
export DEVISE_JWT_SECRET_KEY=my-jwt-secret-key

## Host
export DEFAULT_HOST=example.com
export DEFAULT_HOST=localhost

## Action cable
export ACTION_CABLE_URL=ws://localhost:28080
export ACTION_CABLE_ALLOWED_REQUEST_ORIGINS=http:\/\/localhost*
# Examples:
# http:\/\/localhost*
# http:\/\/example.*,https:\/\/example.*

## Puma
# export PORT=3000

## Workers and threads count
# export WEB_CONCURRENCY=2
# export RAILS_MAX_THREADS=5
# export RAILS_MIN_THREADS=5
export WEB_CONCURRENCY=2
export RAILS_MAX_THREADS=5
export RAILS_MIN_THREADS=5

## Postgres
export POSTGRES_HOST=postgres
export POSTGRES_PORT=5432
export POSTGRES_USER=baseapp
export POSTGRES_PASSWORD=123456
export POSTGRES_PASSWORD=postgres
export POSTGRES_DB=baseapp

## Redis URL
# export REDIS_URL=redis://redis:6379/1
# export REDIS_CHANNEL_PREFIX=baseapp

## Action cable
# export ACTION_CABLE_URL=ws://localhost:28080
# export ACTION_CABLE_ALLOWED_REQUEST_ORIGINS=http:\/\/localhost*
# Examples:
# http:\/\/localhost*
# http:\/\/example.*,https:\/\/example.*

## Sidekiq web
# export SIDEKIQ_WEB_USERNAME=sidekiq-web-dashboard
# export SIDEKIQ_WEB_PASSWORD=sidekiq-web-123
export REDIS_URL=redis://redis:6379/1
export REDIS_CHANNEL_PREFIX=baseapp

# frontend config
VITE_API_URL=http://localhost:3000
# Sidekiq web
export SIDEKIQ_WEB_USERNAME=sidekiq-web-dashboard
export SIDEKIQ_WEB_PASSWORD=sidekiq-web-123
25 changes: 0 additions & 25 deletions .env.test

This file was deleted.

11 changes: 0 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

Expand Down Expand Up @@ -39,11 +33,6 @@ yarn-error.log*
# Ignore SampleCov files
/coverage/*

# Ignore env files
.env*
!.env.example
!.env.test

# Vite Ruby
/public/vite*
node_modules
Expand Down

0 comments on commit f58025d

Please sign in to comment.