Skip to content

Commit

Permalink
Merge pull request #35 from azeddine-hmd/dev
Browse files Browse the repository at this point in the history
allow backend images; refactor dockerfile installing packages
  • Loading branch information
azeddine-hmd authored Aug 31, 2024
2 parents f2065c9 + 109b6ce commit 0de10d2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
6 changes: 1 addition & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ WORKDIR /usr/src/app

COPY ./package*.json ./

RUN if [ "$NODE_ENV" = "production" ]; then \
npm ci --omit=dev; \
else \
npm ci; \
fi
RUN npm ci

COPY . ./
RUN npm install -g prisma
Expand Down
6 changes: 1 addition & 5 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ WORKDIR /usr/src/app

COPY ./package*.json ./

RUN if [ "$NODE_ENV" = "production" ]; then \
npm ci --omit=dev; \
else \
npm ci; \
fi
RUN npm ci

COPY . ./

Expand Down
8 changes: 4 additions & 4 deletions frontend/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { strongEmail } from "@/lib/yup-extra";
import { useFormik } from "formik";
import { motion } from "framer-motion";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useState } from "react";
import * as Yup from "yup";
import { useMutation } from "@tanstack/react-query";
Expand All @@ -26,7 +25,6 @@ const loginSchema = Yup.object().shape({
});

export default function Login() {
const router = useRouter();
const [error, setError] = useState<string | null>(null);
const [emailError, setEmailError] = useState<string | null>(null);
const [onLoading, setOnLoading] = useState(false);
Expand Down Expand Up @@ -70,9 +68,9 @@ export default function Login() {
<h1 className="w-fit text-2xl font-medium text-white">
Welcome back!
</h1>
<h6 className="text-md mt-2 text-muted">
<h2 className="text-md mt-2 text-muted">
We&apos;re excited to see you again!
</h6>
</h2>
{error && (
<h3 className="mt-2 text-lg font-semibold text-red-400">{error}</h3>
)}
Expand All @@ -83,6 +81,7 @@ export default function Login() {
layoutClassName="mb-4"
name="email"
type="email"
aria-label="email"
error={emailError ? emailError : formik.errors.email}
onChange={formik.handleChange}
value={formik.values.email}
Expand All @@ -94,6 +93,7 @@ export default function Login() {
<FormField
name="password"
type="password"
aria-label="password"
error={formik.errors.password}
onChange={formik.handleChange}
value={formik.values.password}
Expand Down
4 changes: 4 additions & 0 deletions frontend/app/(auth)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export default function Register() {
>
<FormField
name="displayName"
aria-label="display name"
error={formik.errors.displayName}
onChange={formik.handleChange}
value={formik.values.displayName}
Expand All @@ -104,6 +105,7 @@ export default function Register() {
</FormField>
<FormField
name="username"
aria-label="username"
error={formik.errors.username}
onChange={formik.handleChange}
value={formik.values.username}
Expand All @@ -113,6 +115,7 @@ export default function Register() {
<FormField
type="password"
name="password"
aria-label="password"
error={formik.errors.password}
onChange={formik.handleChange}
value={formik.values.password}
Expand All @@ -121,6 +124,7 @@ export default function Register() {
</FormField>
<FormField
name="email"
aria-label="email"
error={formik.errors.email}
onChange={formik.handleChange}
value={formik.values.email}
Expand Down
8 changes: 4 additions & 4 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ const nextConfig = {
hostname: "i.pravatar.cc",
protocol: "https",
},
{
hostname: "localhost",
protocol: "http",
},
{
hostname: "backend",
protocol: "http",
Expand All @@ -23,6 +19,10 @@ const nextConfig = {
hostname: "media.discordapp.net",
protocol: "https",
},
(process.env.NODE_ENV === "production") ? {
hostname: process.env.BACKEND_HOST,
protocol: process.env.BACKEND_PROTOCOL,
} : undefined,
],
},
productionBrowserSourceMaps: process.env.NODE_ENV === "development",
Expand Down

0 comments on commit 0de10d2

Please sign in to comment.