Skip to content

Commit

Permalink
tryings to set docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Prrromanssss committed Feb 18, 2024
1 parent 2a4b75b commit eeb85cc
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 46 deletions.
23 changes: 11 additions & 12 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM golang:1.21.1 AS builder
FROM golang:1.21-alpine

RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh

WORKDIR /app

Expand All @@ -10,20 +13,16 @@ RUN go get -u github.com/pressly/goose/cmd/goose

COPY . .

RUN go build -o daee .

FROM debian:buster
COPY .env /app/

COPY --from=builder /app/daee /usr/local/bin/daee

EXPOSE 3000
RUN bash -c 'source /app/.env'

COPY .env /

RUN bash -c 'source /.env'
RUN go build cmd/daee/main.go

COPY sql/schema /app/sql/schema

RUN cd /app/sql/schema && goose postgres postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB} up
RUN cd /app/sql/schema && goose postgres "postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}" up

EXPOSE 3000

CMD ["daee"]
CMD ["./main"]
30 changes: 0 additions & 30 deletions frontend/README.md

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/calculator.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Distributed arithmetic expression evaluator</title>
</head>
<body>
<div id="root"></div>
Expand Down
Binary file added frontend/public/calculator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion frontend/src/components/Button/Button.module.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
.btn {
background: blueviolet;
color: white;
padding: 15px 20px;
border-radius: 10px;
border: none;
outline: none;
cursor: pointer;
height: 84px;
width: 120px;
font-size: 25px;
}

.btn:hover {
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/Input/Input.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
padding: 15px;
border-radius: 10px;
border: 1px solid blueviolet;
min-width: 300px;
min-width: 500px;
height: 52px;
font-size: 25px;
}

.input:focus-visible {
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/pages/Operations/OperationsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ import { useEffect, useState } from "react";
import { Operation } from "src/ts/interfaces";
import { OperationBlock } from "src/components/OperationBlock/OperationBlock";
import { getOperations, updateOperation } from "src/services/api";
import { toast } from 'react-toastify';

export const OperationsPage = () => {
const [operations, setOperations] = useState<Operation[]>([]);

const saveChanges = (newValue: number, operation: Operation) => {
updateOperation({ ...operation, execution_time: newValue })
.then(() => {
toast.success("Success");
getOperations()
.then(data => setOperations(data));
})
.catch((err) => {
toast.error(err.response.data.error);
});
};

Expand Down

0 comments on commit eeb85cc

Please sign in to comment.