* Migrate to esbuild WIP * Add exclude * Remove redundant file * Move file * Move to javascript_include_tag * Lint fix * WIP * WIP * Add watch mode to esbuild WIP * Get jest working * Remove babel * Revert "Remove babel" This reverts commit 6da35260aa19d6f97f586deb66c0ecaf48433b73. * More WIP * Got image to load * WIP * Resolve audit * Lint fix * WIP * Fix jest spec * [CI] Remove asset-restore for test build stage * Production compliant * Temp disable sourcemap * Update glob * Add esbuild helper to stimulus * Import fragment * Temp disable coverage to see failing tests * Fix broken spec * Address lint * Set proper es6 target * Use esbuild for everything * wait what * Revert "Set proper es6 target" This reverts commit 98f5278093421baa8ffe2ca580845b01c1a1eadf. * Revert "Use esbuild for everything" This reverts commit 0ac46738f07ffcb6af095ccb1ffa5e439b7fefa3. * Replace uglifier with terser * New compiled assets version * Remvoe honeybadger-io/webpack * Remove cypress coverage checks for now * Update jsconfig.json * Update docker-compose * Remove public/packs-test from ci cache
164 lines
4.1 KiB
YAML
164 lines
4.1 KiB
YAML
x-app: &app
|
|
build:
|
|
target: development
|
|
context: .
|
|
args:
|
|
PG_MAJOR: '13'
|
|
image: ghcr.io/forem/forem:development
|
|
environment: &env
|
|
NODE_ENV: ${NODE_ENV:-development}
|
|
RAILS_ENV: ${RAILS_ENV:-development}
|
|
tmpfs:
|
|
- /tmp
|
|
- /app/tmp/pids
|
|
|
|
x-backend: &backend
|
|
<<: *app
|
|
stdin_open: true
|
|
tty: true
|
|
volumes:
|
|
- ${LOCAL_WORKSPACE_FOLDER:-.}:/app:cached
|
|
- bundle:/usr/local/bundle
|
|
- cypress:/root/.cache/Cypress
|
|
- rails_cache:/app/tmp/cache
|
|
- assets:/app/public/assets
|
|
- node_modules:/app/node_modules
|
|
- builds:/app/public/builds
|
|
- history:/usr/local/hist
|
|
- ${LOCAL_WORKSPACE_FOLDER:-.}/.dockerdev/.psqlrc:/root/.psqlrc:ro
|
|
environment: &backend_environment
|
|
<<: *env
|
|
CHROME_URL: http://chrome:3333
|
|
REDIS_URL: redis://redis:6379/
|
|
DATABASE_URL: postgres://postgres:postgres@postgres:5432
|
|
DATABASE_URL_TEST: postgres://postgres:postgres@postgres:5432
|
|
MALLOC_ARENA_MAX: 2
|
|
WEB_CONCURRENCY: ${WEB_CONCURRENCY:-1}
|
|
BOOTSNAP_CACHE_DIR: /usr/local/bundle/_bootsnap
|
|
XDG_DATA_HOME: /app/tmp/cache
|
|
YARN_CACHE_FOLDER: /app/node_modules/.yarn-cache
|
|
HISTFILE: /usr/local/hist/.bash_history
|
|
PSQL_HISTFILE: /usr/local/hist/.psql_history
|
|
IRB_HISTFILE: /usr/local/hist/.irb_history
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
services:
|
|
devcontainer:
|
|
<<: *backend
|
|
environment:
|
|
MALLOC_ARENA_MAX: 2
|
|
WEB_CONCURRENCY: ${WEB_CONCURRENCY:-1}
|
|
REDIS_URL: redis://redis:6379/
|
|
DATABASE_URL: postgres://postgres:postgres@postgres:5432
|
|
DATABASE_URL_TEST: postgres://postgres:postgres@postgres:5432
|
|
CHROME_URL: http://chrome:3333
|
|
volumes:
|
|
- ${LOCAL_WORKSPACE_FOLDER:-.}:/workspaces/forem:cached
|
|
- bundle:/usr/local/bundle
|
|
- cypress:/root/.cache/Cypress
|
|
- rails_cache:/workspaces/forem/tmp/cache
|
|
- assets:/workspaces/forem/public/assets
|
|
- node_modules:/workspaces/forem/node_modules
|
|
- builds:/workspaces/forem/app/assets/builds
|
|
- history:/usr/local/hist
|
|
- ${LOCAL_WORKSPACE_FOLDER:-.}/.dockerdev/.psqlrc:/root/.psqlrc:ro
|
|
- /var/run/docker.sock:/var/run/docker-host.sock
|
|
command: sleep infinity
|
|
tmpfs:
|
|
- /workspaces/forem/tmp/pids
|
|
ports:
|
|
- '3000:3000'
|
|
|
|
rails:
|
|
<<: *backend
|
|
command: bundle exec rails
|
|
|
|
web:
|
|
<<: *backend
|
|
command: bundle exec rails server -b 0.0.0.0
|
|
ports:
|
|
- '3000:3000'
|
|
depends_on:
|
|
esbuild:
|
|
condition: service_started
|
|
sidekiq:
|
|
condition: service_started
|
|
|
|
sidekiq:
|
|
<<: *backend
|
|
command: bundle exec sidekiq
|
|
|
|
postgres:
|
|
image: postgres:13
|
|
volumes:
|
|
- ${LOCAL_WORKSPACE_FOLDER:-.}/.dockerdev/.psqlrc:/root/.psqlrc:ro
|
|
- postgres:/var/lib/postgresql/data
|
|
- history:/usr/local/hist
|
|
environment:
|
|
PSQL_HISTFILE: /usr/local/hist/.psql_history
|
|
POSTGRES_PASSWORD: postgres
|
|
ports:
|
|
- 5432
|
|
healthcheck:
|
|
test: pg_isready -U postgres -h 127.0.0.1
|
|
interval: 5s
|
|
|
|
redis:
|
|
image: redis:7.0-alpine
|
|
volumes:
|
|
- redis:/data
|
|
ports:
|
|
- 6379
|
|
healthcheck:
|
|
test: redis-cli ping
|
|
interval: 1s
|
|
timeout: 3s
|
|
retries: 30
|
|
|
|
esbuild:
|
|
<<: *app
|
|
command: yarn build --watch
|
|
volumes:
|
|
- ${LOCAL_WORKSPACE_FOLDER:-.}:/app:cached
|
|
- bundle:/usr/local/bundle
|
|
- node_modules:/app/node_modules
|
|
- builds:/app/assets/builds
|
|
environment:
|
|
<<: *env
|
|
WEBPACKER_DEV_SERVER_HOST: 0.0.0.0
|
|
YARN_CACHE_FOLDER: /app/node_modules/.yarn-cache
|
|
|
|
chrome:
|
|
image: browserless/chrome:latest
|
|
ports:
|
|
- "3333:3333"
|
|
# Mount application source code to support file uploading
|
|
# (otherwise Chrome won't be able to find files).
|
|
# NOTE: Make sure you use absolute paths in `#attach_file`.
|
|
volumes:
|
|
- ${LOCAL_WORKSPACE_FOLDER:-.}:/app:cached
|
|
environment:
|
|
PORT: 3333
|
|
CONNECTION_TIMEOUT: 600000
|
|
|
|
rspec_system:
|
|
<<: *backend
|
|
depends_on:
|
|
chrome:
|
|
condition: service_started
|
|
|
|
volumes:
|
|
bundle:
|
|
cypress:
|
|
node_modules:
|
|
history:
|
|
rails_cache:
|
|
postgres:
|
|
redis:
|
|
assets:
|
|
builds:
|
|
|