Skip to content

Commit

Permalink
Dev improvements
Browse files Browse the repository at this point in the history
Add more user ids to groups. This is not ideal, but is one of the only ways to make the compose solution work with bind mounts and files from non UID 1000 users.

Attempted to use docker compose watch to replace rerun. The feature is not ready yet.

Simplified rerun script to use a manually set environment variable.

Changed sftpgo to use it's own databases. When it shared a database with rails they often stepped on each other's toes. It also helps the solution to boot without deadlocks: it used to be that upload needed a database, web creates the db, but web can't start because it depends on upload.

Removed .touch and the web health check. The .touch files were made by any container, which means workers could end up signalling healthy for the web container.... which was incorrect. Could not determine any reason for the health check to remain.

Split entrypoint into dev_start. That way dev maintenance tasks are only run: a) in development and b) on the web service.
  • Loading branch information
atruskie committed Jan 13, 2025
1 parent 35242f5 commit 1973b7f
Show file tree
Hide file tree
Showing 15 changed files with 107 additions and 364 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
# security_opt:
# - seccomp:unconfined
# Overrides default command so things don't shut down after the process ends.
command: bash -c 'touch .ready && sleep infinity'
#command:
volumes:
baw-server-vscode-extensions:
baw-server-vscode-bash-history:
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ RUN --mount=type=bind,source=./provision,target=/provision \
# the following are for nokogiri and the like
build-essential patch ruby-dev zlib1g-dev liblzma-dev \
# for the pg gem we need postgresql-client (also used by rails rake db commands)
&& /provision/install_postgresql_client.sh \
&& /provision/web/install_postgresql_client.sh \
# install audio tools and other binaries
&& /provision/install_audio_tools.sh
&& /provision/web/install_audio_tools.sh

RUN --mount=type=bind,source=./provision,target=/provision \
# create a user for the app
Expand All @@ -45,7 +45,7 @@ RUN --mount=type=bind,source=./provision,target=/provision \
&& mkdir -p /home/${app_user}/${app_name}/tmp \
&& mkdir /data \
&& chown -R 1000:1000 /data \
&& (if [ "x${trimmed}" != "xtrue" ]; then /provision/dev_setup.sh ; fi)
&& (if [ "x${trimmed}" != "xtrue" ]; then /provision/web/dev_setup.sh ; fi)


ENV RAILS_ENV=production \
Expand All @@ -62,7 +62,8 @@ ENV RAILS_ENV=production \
# must be done in context (i.e. in production for production, not in dev for production)
# should not be done for workers and in dev/test environments
GENERATE_ASSETS=false \
BINDING=0.0.0.0
BINDING=0.0.0.0 \
RUBY_YJIT_ENABLE=1


# "Install" our metadata utility
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ Install:

### MacOS

Install Docker Desktop
Install Docker Desktop.

MacOS users will need to `export RERUN_FORCE_POLLING=true` to disable
inotify polling for the rerun code reloading gem. This is because Docker Desktop for Mac does not support inotify through binds.

### Linux

Expand Down
230 changes: 0 additions & 230 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1799,236 +1799,6 @@ CREATE SEQUENCE public.scripts_id_seq
ALTER SEQUENCE public.scripts_id_seq OWNED BY public.scripts.id;


--
-- Name: sftpgo_admins_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_admins_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_admins_id_seq1; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_admins_id_seq1
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_api_keys_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_api_keys_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_api_keys_id_seq1; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_api_keys_id_seq1
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_defender_events_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_defender_events_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_defender_events_id_seq1; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_defender_events_id_seq1
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_defender_hosts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_defender_hosts_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_defender_hosts_id_seq1; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_defender_hosts_id_seq1
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_folders_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_folders_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_folders_id_seq1; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_folders_id_seq1
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_folders_mapping_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_folders_mapping_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_folders_mapping_id_seq1; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_folders_mapping_id_seq1
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_schema_version_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_schema_version_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_schema_version_id_seq1; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_schema_version_id_seq1
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_shares_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_shares_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_shares_id_seq1; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_shares_id_seq1
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_users_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sftpgo_users_id_seq1; Type: SEQUENCE; Schema: public; Owner: -
--

CREATE SEQUENCE public.sftpgo_users_id_seq1
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


--
-- Name: sites; Type: TABLE; Schema: public; Owner: -
--
Expand Down
Loading

0 comments on commit 1973b7f

Please sign in to comment.