Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
dev deploymment
Browse files Browse the repository at this point in the history
  • Loading branch information
rohansharmasitoula committed Jun 4, 2024
1 parent 0e63cfc commit 655fa2a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 55 deletions.
45 changes: 15 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GENERATED FILE, DO NOT MODIFY!
# To update this file please edit the relevant template and run the generation
# task `build/dockerfile_writer.rb --env development --compose-file docker-compose.yml,docker-compose.override.yml --in build/Dockerfile.template --out Dockerfile`
# task `build/dockerfile_writer.rb --env production --compose-file docker-compose.yml,docker-compose.override.yml --in build/Dockerfile.template --out Dockerfile.production`

ARG RUBY=3.1

Expand All @@ -10,7 +10,9 @@ LABEL maintainer="Instructure"
ARG RUBY
ARG POSTGRES_CLIENT=14
ENV APP_HOME /usr/src/app/
ENV RAILS_ENV development
ENV RAILS_ENV production
ENV SASS_STYLE compressed
env RAILS_LOAD_ALL_LOCALES=1
ENV NGINX_MAX_UPLOAD_SIZE 10g
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
Expand All @@ -28,13 +30,6 @@ ENV BUNDLE_APP_CONFIG /home/docker/.bundle
WORKDIR $APP_HOME

USER root

ARG USER_ID
# This step allows docker to write files to a host-mounted volume with the correct user permissions.
# Without it, some linux distributions are unable to write at all to the host mounted volume.
RUN if [ -n "$USER_ID" ]; then usermod -u "${USER_ID}" docker \
&& chown --from=9999 docker /usr/src/nginx /usr/src/app -R; fi

RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
Expand All @@ -57,7 +52,7 @@ RUN mkdir -p /etc/apt/keyrings \
postgresql-client-$POSTGRES_CLIENT \
unzip \
pbzip2 \
fontforge \
\
git \
build-essential \
&& rm -rf /var/lib/apt/lists/* \
Expand All @@ -69,23 +64,13 @@ RUN npm install -g [email protected] && npm cache clean --force

USER docker

RUN set -eux; \
mkdir -p \
.yardoc \
app/stylesheets/brandable_css_brands \
app/views/info \
config/locales/generated \
log \
node_modules \
packages/js-utils/es \
packages/js-utils/lib \
packages/js-utils/node_modules \
pacts \
public/dist \
public/doc/api \
public/javascripts/translations \
reports \
tmp \
/home/docker/.bundle/ \
/home/docker/.cache/yarn \
/home/docker/.gem/
COPY --chown=docker:docker . /usr/src/app
RUN mkdir -p tmp/files
ENV COMPILE_ASSETS_BRAND_CONFIGS=0
ENV COMPILE_ASSETS_NPM_INSTALL=0
RUN unset RUBY && bundle config --global build.nokogiri --use-system-libraries && \
bundle config --global build.ffi --enable-system-libffi && \
bundle install
RUN yarn install --frozen-lockfile || yarn install --frozen-lockfile --network-concurrency 1 && \
bin/rails canvas:compile_assets --trace && \
rm -rf node_modules
36 changes: 11 additions & 25 deletions config/database.yml.example
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
# do not create a queue: section for your test environment
test:
common: &common
adapter: postgresql
host: <%= ENV.fetch('PGHOST', 'postgres') %>
password: <%= ENV.fetch('PGPASSWORD') %>
encoding: utf8
database: canvas_test
host: localhost
username: canvas
password: your_password
username: <%= ENV.fetch('PGUSER', 'postgres') %>
timeout: 5000
shard1: canvas_test_shard_1
shard2: canvas_test_shard_2

development:
adapter: postgresql
encoding: utf8
database: canvas_development
password: your_password
timeout: 5000
secondary:
replica: true
username: canvas_readonly_user
prepared_statements: false
use_qualified_names: true
shard_name: public
schema_search_path: "''"

production:
adapter: postgresql
encoding: utf8
database: canvas_production
host: localhost
username: canvas
password: your_password
timeout: 5000
<<: *common
database: <%= ENV.fetch('PGDATABASE', 'canvas_production') %>

0 comments on commit 655fa2a

Please sign in to comment.