Compare commits
No commits in common. "main" and "docker" have entirely different histories.
26
.gitignore
vendored
26
.gitignore
vendored
@ -1,26 +0,0 @@
|
||||
# ---> Java
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
|
||||
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
FROM python:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PIP_NO_CACHE_DIR=1\
|
||||
PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip install --upgrade pip -r /app/requirements.txt
|
||||
|
||||
COPY flaskApp.py /app/flaskApp.py
|
||||
|
||||
USER root
|
||||
|
||||
CMD ["python", "flaskApp.py", "--host", "0.0.0.0", "--port", "80"]
|
||||
13
flaskApp.py
Normal file
13
flaskApp.py
Normal file
@ -0,0 +1,13 @@
|
||||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/')
|
||||
def hello():
|
||||
return "Привет из Docker!"
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True, host='0.0.0.0', port=80)
|
||||
|
||||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
@ -1,23 +0,0 @@
|
||||
import animals.Kotik;
|
||||
|
||||
public class Application {
|
||||
public static void main(String[] args) {
|
||||
Kotik firstKot = new Kotik("Petr", "hi", 10, 5);
|
||||
Kotik secondKot = new Kotik();
|
||||
secondKot.setName("Barsik");
|
||||
secondKot.setVoice("hello");
|
||||
secondKot.setSatiety(5);
|
||||
secondKot.setWeight(3);
|
||||
for(String str : firstKot.liveAnotherDay()){
|
||||
System.out.println(str);
|
||||
}
|
||||
System.out.println(secondKot.getName());
|
||||
System.out.println(secondKot.getWeight());
|
||||
System.out.println(Application.compareVoice(firstKot, secondKot));
|
||||
System.out.println(Kotik.getCount());
|
||||
}
|
||||
|
||||
public static boolean compareVoice(Kotik firstKot, Kotik secondKot){
|
||||
return firstKot.getVoice().equals(secondKot.getVoice());
|
||||
}
|
||||
}
|
||||
@ -1,182 +0,0 @@
|
||||
package animals;
|
||||
|
||||
public class Kotik {
|
||||
|
||||
private static final int METHODS = 5;
|
||||
|
||||
private static int count = 0;
|
||||
|
||||
private String name;
|
||||
private String voice;
|
||||
private int satiety;
|
||||
private int weight;
|
||||
|
||||
public Kotik(String name, String voice, int satiety, int weight) {
|
||||
this.name = name;
|
||||
this.voice = voice;
|
||||
this.satiety = satiety;
|
||||
this.weight = weight;
|
||||
count++;
|
||||
}
|
||||
|
||||
public Kotik() {
|
||||
count++;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getVoice() {
|
||||
return voice;
|
||||
}
|
||||
|
||||
public void setVoice(String voice) {
|
||||
this.voice = voice;
|
||||
}
|
||||
|
||||
public int getSatiety() {
|
||||
return satiety;
|
||||
}
|
||||
|
||||
public void setSatiety(int satiety) {
|
||||
this.satiety = satiety;
|
||||
}
|
||||
|
||||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(int weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public static int getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void eat(int units) {
|
||||
System.out.println("Kotik is eating");
|
||||
this.satiety += units;
|
||||
}
|
||||
|
||||
public void eat(int units, String food) {
|
||||
System.out.println("Kotik is eating " + food);
|
||||
this.satiety += units;
|
||||
}
|
||||
|
||||
public void eat() {
|
||||
eat(2, "fish");
|
||||
}
|
||||
|
||||
public boolean play() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is playing");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean sleep() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is sleeping");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean wash() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is washing");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean walk() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is walking");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hunt() {
|
||||
if (satiety > 0) {
|
||||
System.out.println("Kotik is hunting");
|
||||
satiety--;
|
||||
return true;
|
||||
} else {
|
||||
System.out.println("kotik wanna eat");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public String[] liveAnotherDay() {
|
||||
String[] kotikToDoList = new String[24];
|
||||
for (int i = 0; i < 24; i++) {
|
||||
switch ((int) (Math.random() * METHODS) + 1) {
|
||||
case (1):
|
||||
if (play())
|
||||
kotikToDoList[i] =(i + " - play");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
case (2):
|
||||
if (sleep())
|
||||
kotikToDoList[i] =(i + " - sleep");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
case (3):
|
||||
if (wash())
|
||||
kotikToDoList[i] =(i + " - wash");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
case (4):
|
||||
if (walk())
|
||||
kotikToDoList[i] =(i + " - walk");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
case (5):
|
||||
if (hunt())
|
||||
kotikToDoList[i] =(i + " - hunt");
|
||||
else {
|
||||
eat();
|
||||
kotikToDoList[i] =(i + " - eat");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
System.out.println("something wrong");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return kotikToDoList;
|
||||
}
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
task1= INSERT INTO helpdesk_ticket (title, created, modified, submitter_email, status, on_hold, description, priority, queue_id, secret_key) VALUES ('Ticket for test', CAST('2026-01-19' AS DATE), CAST('2026-01-20' AS DATE), 'some@mail.ru', 2, TRUE, 'test ticket for sql', 1, 1, 1);
|
||||
task2= update helpdesk_ticket set submitter_email = 'ticketchange@mail.ru' where %s = 77
|
||||
task3=delete from helpdesk_ticket where %s = 77
|
||||
Loading…
Reference in New Issue
Block a user