Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Dockerize frontend project #19

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,34 @@ services:
timeout: 2s
retries: 10

frontend:
image: aaissaut/aaiss:frontend
build:
context: ./frontend
cache_from:
- aaissaut/aaiss:frontend
volumes:
- static_files:/run/dist
ports:
- "8080:8080"

caddy:
depends_on:
backend:
condition: service_healthy
frontend:
condition: service_completed_successfully
image: caddy:2.7.3
volumes:
- ./deployment/caddy:/etc/caddy
- ./backend/static:/static
- ./backend/media:/media
- ./dist:/dist
- static_files:/dist:ro
- caddy_data:/data/caddy
ports:
- "80:80"
- "443:443"

volumes:
caddy_data:
caddy_data:
static_files:
5 changes: 5 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.gitignore
README.md
dist
node_modules
9 changes: 9 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:20.10.0

WORKDIR /run

COPY package*.json .
RUN npm install

COPY . .
RUN npm run build
2 changes: 1 addition & 1 deletion frontend/src/pages/ForgotPassword/ForgotPassword.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, FormControl } from '@mui/material'
import React from 'react'
import FormTextField from '../../Components/Form/FormTextField'
import FormTextField from '../../components/Form/FormTextField'
import '../../css/ForgotPassword.css'
export default function ForgotPassword() {
return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Signup/Signup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useNavigate, useLocation, useSearchParams } from 'react-router-dom';
import { Button, Checkbox, FormControl, FormControlLabel, FormHelperText, Stack, Typography } from '@mui/material';
import ForgotPassModal from '../../components/forgot-pass-modal/forgot-pass-modal';
import FormTextField from '../../components/Form/FormTextField';
import Toast from '../../Components/toast/Toast.jsx';
import Toast from '../../components/toast/Toast.jsx';
import { useAPI } from '../../providers/APIProvider/APIProvider.jsx';
import { useConfig } from '../../providers/config-provider/ConfigProvider.jsx';
import ROUTES from '../../providers/config-provider/ROUTES.jsx';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/my-account/MyAccount.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { Box, Button, CircularProgress, Divider, Stack, Tab, Tabs, Typography } from '@mui/material';
import ItemCard from '../../components/item-card/item-card.jsx';
import Toast from '../../Components/toast/Toast.jsx';
import Toast from '../../components/toast/Toast.jsx';
import { Helper } from '../../utils/Helper.js';
import useMyAccount from './useMyAccount.js';

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/workshops/WorkshopsPage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ItemCard from "../../Components/item-card/item-card.jsx";
import Toast from "../../Components/toast/Toast.jsx";
import ItemCard from "../../components/item-card/item-card.jsx";
import Toast from "../../components/toast/Toast.jsx";
import {Helper} from "../../utils/Helper.js";
import useWorkshopsPage from "./useWorkshopsPage.js";

Expand Down