Skip to content

Commit

Permalink
docker: use concurrently instead of supervisord (#564)
Browse files Browse the repository at this point in the history
* docker: use concurrently instead of supervisord

* fix typo

* chore(frontend): set default api url

* ci: adjust to new backend

* ci: add required packages

* fix(backend): deploy bulk metadata update

* chore(frontend): apply lints

* build(backend): bump version

---------

Co-authored-by: Diptesh Choudhuri <[email protected]>
  • Loading branch information
vnghia and IgnisDa committed Jan 11, 2024
1 parent a4ef70c commit b6fb746
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ RUN ./apps/backend/ci/build-app.sh

FROM $NODE_BASE_IMAGE
COPY --from=caddy:2.7.5 /usr/bin/caddy /usr/local/bin/caddy
RUN apt-get update && apt-get install -y --no-install-recommends curl supervisor ca-certificates && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates && rm -rf /var/lib/apt/lists/*
RUN npm install --global concurrently && concurrently --version
RUN useradd -m -u 1001 ryot
WORKDIR /home/ryot
USER ryot
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY config/Caddyfile /etc/caddy/Caddyfile
COPY --from=frontend-builder --chown=ryot:ryot /app/apps/frontend/node_modules ./node_modules
COPY --from=frontend-builder --chown=ryot:ryot /app/apps/frontend/package.json ./package.json
Expand All @@ -57,4 +57,4 @@ COPY --from=frontend-builder --chown=ryot:ryot /app/apps/frontend/public ./publi
COPY --from=app-builder --chown=ryot:ryot /app/ryot /usr/local/bin/ryot
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost:5000/config || exit 1
CMD [ "/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf" ]
CMD [ "concurrently", "--names", "frontend,backend,proxy", "-k", "npx remix-serve ./build/index.js", "ryot", "caddy run --config /etc/caddy/Caddyfile" ]
2 changes: 1 addition & 1 deletion apps/backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ryot"
version = "4.0.14"
version = "4.0.15"
edition = "2021"
repository = "https://github.com/IgnisDa/ryot"
license = "GPL-V3"
Expand Down
1 change: 1 addition & 0 deletions apps/backend/src/miscellaneous/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2671,6 +2671,7 @@ impl MiscellaneousService {
let many_metadata = Metadata::find()
.select_only()
.column(metadata::Column::Id)
.filter(metadata::Column::IsPartial.eq(false))
.order_by_asc(metadata::Column::LastUpdatedOn)
.into_tuple::<i32>()
.all(&self.db)
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/app/lib/api.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { redirectToQueryParam } from "./generals";
import { createToastHeaders } from "./toast.server";
import { combineHeaders, getLogoutCookies } from "./utilities.server";

export const API_URL = process.env.API_URL;
export const API_URL = process.env.API_URL || "http://localhost:5000";

export const gqlClient = new GraphQLClient(`${API_URL}/graphql`, {
headers: { Connection: "keep-alive" },
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/app/lib/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { $path } from "@ignisda/remix-routes";
import { useMantineTheme } from "@mantine/core";
import { useNavigate, useSearchParams } from "@remix-run/react";
import { useAtom } from "jotai";
import Cookies from "js-cookie";
import { COOKIES_KEYS, getStringAsciiValue } from "./generals";
import { InProgressWorkout, currentWorkoutAtom } from "./workout";
import Cookies from "js-cookie";

export function useGetMantineColor() {
const theme = useMantineTheme();
Expand Down
15 changes: 0 additions & 15 deletions config/supervisord.conf

This file was deleted.

0 comments on commit b6fb746

Please sign in to comment.