Skip to content

Commit

Permalink
feat: Dockerize frontend project (#19)
Browse files Browse the repository at this point in the history
* feat: dockerize frontend project

* fix: change Components directory to components
  • Loading branch information
Adibov authored Nov 27, 2023
1 parent 1d7da5c commit f629716
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 7 deletions.
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

0 comments on commit f629716

Please sign in to comment.