Skip to content

Commit

Permalink
Update to postgres client 16 in container
Browse files Browse the repository at this point in the history
  • Loading branch information
matthijsgroen committed Oct 2, 2024
1 parent d59264c commit faa623d
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 39 deletions.
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ gem 'file_validators', '~> 2.3'
gem "friendly_id", "~> 5.2.4"
gem "google-id-token", "~> 1.4"
gem "graphql", "~> 1.10"
gem "graphql-batch", "~> 0.3.10"
gem 'graphql-guard', '~> 1.2', '>= 1.2.1'
gem "graphql-batch", "~> 0.6.0"
# gem 'graphql-guard', '~> 1.2', '>= 1.2.1'
gem 'graphql-playground', "0.1.2"
gem "haml-rails", "~> 2.1"
gem "jbuilder", "~> 2.0"
Expand Down Expand Up @@ -52,7 +52,6 @@ gem 'sidekiq', '~> 6.0'
gem 'slack-ruby-client', '~> 0.14.6'
gem 'apollo_upload_server', '~> 2.1.0'
gem 'image_processing', '1.12.2'
gem "sassc-rails"

group :development, :staging, :test do
gem 'database_cleaner', '~> 1.7'
Expand Down
27 changes: 8 additions & 19 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ GEM
autoprefixer-rails (9.8.6.5)
execjs
aws-eventstream (1.3.0)
aws-partitions (1.981.0)
aws-partitions (1.982.0)
aws-sdk-core (3.209.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand Down Expand Up @@ -170,14 +170,12 @@ GEM
graphql-client
graphql (1.13.23)
base64
graphql-batch (0.3.10)
graphql (>= 0.8, < 2)
graphql-batch (0.6.0)
graphql (>= 1.12.18, < 3)
promise.rb (~> 0.7.2)
graphql-client (0.23.0)
activesupport (>= 3.0)
graphql (>= 1.13.0)
graphql-guard (1.3.1)
graphql (>= 1.6.0, < 2)
graphql-playground (0.1.2)
railties (>= 4.1.0)
haml (6.3.0)
Expand Down Expand Up @@ -219,9 +217,10 @@ GEM
net-smtp
marcel (1.0.4)
method_source (1.1.0)
mime-types (3.5.2)
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0903)
mime-types-data (3.2024.1001)
mimemagic (0.3.10)
nokogiri (~> 1)
rake
Expand All @@ -230,7 +229,7 @@ GEM
mini_portile2 (2.8.7)
minitest (5.25.1)
multipart-post (2.4.1)
net-imap (0.3.7)
net-imap (0.4.16)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -365,14 +364,6 @@ GEM
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
scss_lint (0.60.0)
sass (~> 3.5, >= 3.5.5)
sentry-raven (2.13.0)
Expand Down Expand Up @@ -455,8 +446,7 @@ DEPENDENCIES
google-id-token (~> 1.4)
graphlient (~> 0.3.3)
graphql (~> 1.10)
graphql-batch (~> 0.3.10)
graphql-guard (~> 1.2, >= 1.2.1)
graphql-batch (~> 0.6.0)
graphql-playground (= 0.1.2)
haml-rails (~> 2.1)
image_processing (= 1.12.2)
Expand All @@ -483,7 +473,6 @@ DEPENDENCIES
rspec-rails (~> 3.8)
rubocop (~> 0.83.0)
rubyzip (~> 1.3.0)
sassc-rails
scss_lint (~> 0.54)
sentry-raven
settingslogic (~> 2.0, >= 2.0.9)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ development:
test:
<<: *default
database: <%= ENV.fetch("DATABASE_NAME_TEST", "kudo-o-matic_test") %>
url: <%= ENV.fetch("TEST_DATABASE_URL", "postgres://postgres@localhost:5432") %>
url: <%= ENV.fetch("DATABASE_URL", "postgres://kudo_user:kudos@db:5432") %>

staging:
<<: *default
Expand Down
1 change: 0 additions & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
config.active_record.dump_schema_after_migration = false

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
Expand Down
2 changes: 0 additions & 2 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
config.action_mailer.perform_deliveries = true
config.action_mailer.deliveries = []

config.active_record.dump_schema_after_migration = false

# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr

Expand Down
47 changes: 39 additions & 8 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ CREATE TABLE public.activities (
--

CREATE SEQUENCE public.activities_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -147,7 +148,7 @@ CREATE TABLE public.exports (
updated_at timestamp without time zone NOT NULL,
zip_file_name character varying,
zip_content_type character varying,
zip_file_size integer,
zip_file_size bigint,
zip_updated_at timestamp without time zone
);

Expand All @@ -157,6 +158,7 @@ CREATE TABLE public.exports (
--

CREATE SEQUENCE public.exports_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -189,6 +191,7 @@ CREATE TABLE public.fcm_tokens (
--

CREATE SEQUENCE public.fcm_tokens_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -222,6 +225,7 @@ CREATE TABLE public.friendly_id_slugs (
--

CREATE SEQUENCE public.friendly_id_slugs_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -256,6 +260,7 @@ CREATE TABLE public.goals (
--

CREATE SEQUENCE public.goals_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -289,6 +294,7 @@ CREATE TABLE public.guidelines (
--

CREATE SEQUENCE public.guidelines_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -322,6 +328,7 @@ CREATE TABLE public.kudos_meters (
--

CREATE SEQUENCE public.kudos_meters_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -358,6 +365,7 @@ CREATE TABLE public.oauth_access_grants (
--

CREATE SEQUENCE public.oauth_access_grants_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -395,6 +403,7 @@ CREATE TABLE public.oauth_access_tokens (
--

CREATE SEQUENCE public.oauth_access_tokens_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -430,6 +439,7 @@ CREATE TABLE public.oauth_applications (
--

CREATE SEQUENCE public.oauth_applications_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -488,7 +498,7 @@ CREATE TABLE public.posts (
updated_at timestamp without time zone NOT NULL,
image_file_name character varying,
image_content_type character varying,
image_file_size integer,
image_file_size bigint,
image_updated_at timestamp without time zone,
slack_reaction_created_at character varying,
slack_transaction_updated_at character varying,
Expand All @@ -503,6 +513,7 @@ CREATE TABLE public.posts (
--

CREATE SEQUENCE public.posts_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -533,7 +544,7 @@ CREATE TABLE public.schema_migrations (
CREATE TABLE public.team_invites (
id integer NOT NULL,
team_id integer,
sent_at timestamp without time zone DEFAULT now(),
sent_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
accepted_at timestamp without time zone,
declined_at timestamp without time zone,
email character varying
Expand All @@ -545,6 +556,7 @@ CREATE TABLE public.team_invites (
--

CREATE SEQUENCE public.team_invites_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -581,6 +593,7 @@ CREATE TABLE public.team_members (
--

CREATE SEQUENCE public.team_members_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand All @@ -607,7 +620,7 @@ CREATE TABLE public.teams (
updated_at timestamp without time zone NOT NULL,
logo_file_name character varying,
logo_content_type character varying,
logo_file_size integer,
logo_file_size bigint,
logo_updated_at timestamp without time zone,
slug character varying,
preferences json,
Expand All @@ -623,6 +636,7 @@ CREATE TABLE public.teams (
--

CREATE SEQUENCE public.teams_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -685,6 +699,7 @@ CREATE TABLE public.users (
--

CREATE SEQUENCE public.users_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -712,8 +727,8 @@ CREATE TABLE public.votes (
vote_flag boolean,
vote_scope character varying,
vote_weight integer,
created_at timestamp without time zone,
updated_at timestamp without time zone
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);


Expand All @@ -722,6 +737,7 @@ CREATE TABLE public.votes (
--

CREATE SEQUENCE public.votes_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
Expand Down Expand Up @@ -989,6 +1005,14 @@ ALTER TABLE ONLY public.posts
ADD CONSTRAINT posts_pkey PRIMARY KEY (id);


--
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.schema_migrations
ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);


--
-- Name: team_invites team_invites_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
Expand Down Expand Up @@ -1232,6 +1256,13 @@ CREATE UNIQUE INDEX index_users_on_unlock_token ON public.users USING btree (unl
CREATE INDEX index_votes_on_votable_id_and_votable_type_and_vote_scope ON public.votes USING btree (votable_id, votable_type, vote_scope);


--
-- Name: index_votes_on_votable_type_and_votable_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_votes_on_votable_type_and_votable_id ON public.votes USING btree (votable_type, votable_id);


--
-- Name: index_votes_on_voter_id_and_voter_type_and_vote_scope; Type: INDEX; Schema: public; Owner: -
--
Expand All @@ -1240,10 +1271,10 @@ CREATE INDEX index_votes_on_voter_id_and_voter_type_and_vote_scope ON public.vot


--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
-- Name: index_votes_on_voter_type_and_voter_id; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version);
CREATE INDEX index_votes_on_voter_type_and_voter_id ON public.votes USING btree (voter_type, voter_id);


--
Expand Down
30 changes: 25 additions & 5 deletions dockerfiles/development/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,40 @@ ENV NODE_ENV development
ENV RAILS_ENV development
ENV RACK_ENV development
ENV ROOT_URL 0.0.0.0
ENV DATABASE_HOST db
ENV DATABASE_PORT 5432
ENV DATABASE_USER kudo_user
ENV DATABASE_PASSWORD kudos
ENV DATABASE_NAME kudo-o-matic_development
ENV DATABASE_URL postgres://kudo_user:kudos@db:5432
ENV TEST_DATABASE_URL postgres://kudo_user:kudos@db-test:5432
ENV DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL true
ENV REDIS_URL redis://redis:6379/0
ENV FRONTEND_ROOT_URL http://localhost:9090
ENV MAIL_USERNAME [email protected]

# Install Node.js, npm, Yarn, Python, and build-essential
# Install Node.js, yarn, Python, and build-essential
RUN apt-get update -qq && \
apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
apt-get install -y python build-essential
curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get install -y \
gnupg \
lsb-release \
nodejs \
yarnpkg \
python \
build-essential

# Add the PostgreSQL repository GPG key
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgresql-archive-keyring.gpg

# Add the PostgreSQL APT repository
RUN echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list

# Install PostgreSQL client version 16
RUN apt-get update && apt-get install -y postgresql-client-16

# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

RUN groupadd -r app && useradd --no-log-init -r -m -g app app

Expand Down

0 comments on commit faa623d

Please sign in to comment.