Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

feat: docker-compose #11

Merged
merged 1 commit into from
May 19, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 11 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Use a base image with Java 21
FROM eclipse-temurin:21

RUN mkdir /opt/app
# Create a directory in the container
WORKDIR /app

ADD gradle/wrapper/gradle-wrapper.jar /opt/app/gradle-wrapper.jar
# Copy the rest of the application to the container
COPY . .

# Copy the built JAR file to the root directory
RUN cp build/libs/fastfood-application.jar app.jar

# Expose the port the application runs on
EXPOSE 8080

ENTRYPOINT ["java", "-jar", "/opt/app/gradle-wrapper.jar"]
# Start the application
ENTRYPOINT ["java", "-jar", "app.jar"]
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ plugins {
id 'pmd'
}

jar {
manifest {
attributes(
'Main-Class': 'br.com.fiap.grupo30.fastfood.FastfoodApplication'
)
}
}

group = 'br.com.fiap.grupo30'
version = '0.0.1-SNAPSHOT'

Expand Down Expand Up @@ -59,11 +67,3 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

jar {
manifest {
attributes(
'Main-Class': 'FastfoodApplication'
)
}
}
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: '3.9'

services:
local-postgres-compose:
image: postgres
environment:
POSTGRES_URL: "jdbc:postgresql://localhost:5432/fastfood"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "123456"
ports:
- "5432:5432"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./postgres-data:/var/lib/postgresql/data
command: ["postgres", "-c", "log_statement=all"]
networks:
- postgres-compose-network
api:
build: .
ports:
- "8080:8080"
depends_on:
- local-postgres-compose
networks:
- postgres-compose-network

networks:
postgres-compose-network:
driver: bridge
54 changes: 54 additions & 0 deletions init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
CREATE DATABASE fastfood;

\c fastfood

CREATE TABLE tb_coupon(
"id_coupon" integer CONSTRAINT pk_id_coupon PRIMARY KEY,
"discount" float not null,
"status" boolean not null,
"code" VARCHAR(100) not null
);

CREATE TABLE tb_product(
"id_product" integer CONSTRAINT pk_id_product PRIMARY KEY,
"name" VARCHAR(100) not null,
"price" decimal(12,2) not null,
"category" VARCHAR(50) not null
);

CREATE TABLE tb_customer(
"id_customer" integer CONSTRAINT pk_id_customer PRIMARY KEY,
"name" VARCHAR(200) not null,
"cpf" VARCHAR(11) not null,
"email" VARCHAR(100) not null
);

CREATE TABLE tb_order(
"id_order" integer CONSTRAINT pk_id_order PRIMARY KEY,
"id_customer" integer not null,
FOREIGN KEY ("id_customer") REFERENCES tb_customer ("id_customer") ON DELETE CASCADE,
"status" boolean not null,
"date_order" date,
"id_coupon" integer,
FOREIGN KEY ("id_coupon") REFERENCES tb_coupon ("id_coupon") ON DELETE CASCADE
);

CREATE TABLE tb_order_payment(
"id_order_payment" integer CONSTRAINT pk_id_order_payment PRIMARY KEY,
"id_order" integer not null,
FOREIGN KEY ("id_order") REFERENCES tb_order ("id_order") ON DELETE CASCADE,
"id_customer" integer not null,
FOREIGN KEY ("id_customer") REFERENCES tb_customer ("id_customer") ON DELETE CASCADE,
"status" boolean not null,
"date_order_payment" date
);

CREATE TABLE tb_order_item(
"id_order_item" integer CONSTRAINT pk_id_order_item PRIMARY KEY,
"id_product" integer not null,
FOREIGN KEY ("id_product") REFERENCES tb_product ("id_product") ON DELETE CASCADE,
"id_order" integer not null,
FOREIGN KEY ("id_order") REFERENCES tb_order ("id_order") ON DELETE CASCADE,
"quantity" integer not null,
"amount" decimal(12,2)
);
1 change: 1 addition & 0 deletions postgres-data/PG_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
Binary file added postgres-data/base/1/112
Binary file not shown.
Binary file added postgres-data/base/1/113
Binary file not shown.
Binary file added postgres-data/base/1/1247
Binary file not shown.
Binary file added postgres-data/base/1/1247_fsm
Binary file not shown.
Binary file added postgres-data/base/1/1247_vm
Binary file not shown.
Binary file added postgres-data/base/1/1249
Binary file not shown.
Binary file added postgres-data/base/1/1249_fsm
Binary file not shown.
Binary file added postgres-data/base/1/1249_vm
Binary file not shown.
Binary file added postgres-data/base/1/1255
Binary file not shown.
Binary file added postgres-data/base/1/1255_fsm
Binary file not shown.
Binary file added postgres-data/base/1/1255_vm
Binary file not shown.
Binary file added postgres-data/base/1/1259
Binary file not shown.
Binary file added postgres-data/base/1/1259_fsm
Binary file not shown.
Binary file added postgres-data/base/1/1259_vm
Binary file not shown.
Binary file added postgres-data/base/1/13396
Binary file not shown.
Binary file added postgres-data/base/1/13396_fsm
Binary file not shown.
Binary file added postgres-data/base/1/13396_vm
Binary file not shown.
Empty file added postgres-data/base/1/13399
Empty file.
Binary file added postgres-data/base/1/13400
Binary file not shown.
Binary file added postgres-data/base/1/13401
Binary file not shown.
Binary file added postgres-data/base/1/13401_fsm
Binary file not shown.
Binary file added postgres-data/base/1/13401_vm
Binary file not shown.
Empty file added postgres-data/base/1/13404
Empty file.
Binary file added postgres-data/base/1/13405
Binary file not shown.
Binary file added postgres-data/base/1/13406
Binary file not shown.
Binary file added postgres-data/base/1/13406_fsm
Binary file not shown.
Binary file added postgres-data/base/1/13406_vm
Binary file not shown.
Empty file added postgres-data/base/1/13409
Empty file.
Binary file added postgres-data/base/1/13410
Binary file not shown.
Binary file added postgres-data/base/1/13411
Binary file not shown.
Binary file added postgres-data/base/1/13411_fsm
Binary file not shown.
Binary file added postgres-data/base/1/13411_vm
Binary file not shown.
Empty file added postgres-data/base/1/13414
Empty file.
Binary file added postgres-data/base/1/13415
Binary file not shown.
Empty file added postgres-data/base/1/1417
Empty file.
Empty file added postgres-data/base/1/1418
Empty file.
Binary file added postgres-data/base/1/174
Binary file not shown.
Binary file added postgres-data/base/1/175
Binary file not shown.
Binary file added postgres-data/base/1/2187
Binary file not shown.
Empty file added postgres-data/base/1/2224
Empty file.
Binary file added postgres-data/base/1/2228
Binary file not shown.
Empty file added postgres-data/base/1/2328
Empty file.
Empty file added postgres-data/base/1/2336
Empty file.
Binary file added postgres-data/base/1/2337
Binary file not shown.
Binary file added postgres-data/base/1/2579
Binary file not shown.
Binary file added postgres-data/base/1/2600
Binary file not shown.
Binary file added postgres-data/base/1/2600_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2600_vm
Binary file not shown.
Binary file added postgres-data/base/1/2601
Binary file not shown.
Binary file added postgres-data/base/1/2601_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2601_vm
Binary file not shown.
Binary file added postgres-data/base/1/2602
Binary file not shown.
Binary file added postgres-data/base/1/2602_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2602_vm
Binary file not shown.
Binary file added postgres-data/base/1/2603
Binary file not shown.
Binary file added postgres-data/base/1/2603_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2603_vm
Binary file not shown.
Empty file added postgres-data/base/1/2604
Empty file.
Binary file added postgres-data/base/1/2605
Binary file not shown.
Binary file added postgres-data/base/1/2605_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2605_vm
Binary file not shown.
Binary file added postgres-data/base/1/2606
Binary file not shown.
Binary file added postgres-data/base/1/2606_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2606_vm
Binary file not shown.
Binary file added postgres-data/base/1/2607
Binary file not shown.
Binary file added postgres-data/base/1/2607_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2607_vm
Binary file not shown.
Binary file added postgres-data/base/1/2608
Binary file not shown.
Binary file added postgres-data/base/1/2608_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2608_vm
Binary file not shown.
Binary file added postgres-data/base/1/2609
Binary file not shown.
Binary file added postgres-data/base/1/2609_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2609_vm
Binary file not shown.
Binary file added postgres-data/base/1/2610
Binary file not shown.
Binary file added postgres-data/base/1/2610_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2610_vm
Binary file not shown.
Empty file added postgres-data/base/1/2611
Empty file.
Binary file added postgres-data/base/1/2612
Binary file not shown.
Binary file added postgres-data/base/1/2612_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2612_vm
Binary file not shown.
Empty file added postgres-data/base/1/2613
Empty file.
Binary file added postgres-data/base/1/2615
Binary file not shown.
Binary file added postgres-data/base/1/2615_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2615_vm
Binary file not shown.
Binary file added postgres-data/base/1/2616
Binary file not shown.
Binary file added postgres-data/base/1/2616_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2616_vm
Binary file not shown.
Binary file added postgres-data/base/1/2617
Binary file not shown.
Binary file added postgres-data/base/1/2617_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2617_vm
Binary file not shown.
Binary file added postgres-data/base/1/2618
Binary file not shown.
Binary file added postgres-data/base/1/2618_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2618_vm
Binary file not shown.
Binary file added postgres-data/base/1/2619
Binary file not shown.
Binary file added postgres-data/base/1/2619_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2619_vm
Binary file not shown.
Empty file added postgres-data/base/1/2620
Empty file.
Binary file added postgres-data/base/1/2650
Binary file not shown.
Binary file added postgres-data/base/1/2651
Binary file not shown.
Binary file added postgres-data/base/1/2652
Binary file not shown.
Binary file added postgres-data/base/1/2653
Binary file not shown.
Binary file added postgres-data/base/1/2654
Binary file not shown.
Binary file added postgres-data/base/1/2655
Binary file not shown.
Binary file added postgres-data/base/1/2656
Binary file not shown.
Binary file added postgres-data/base/1/2657
Binary file not shown.
Binary file added postgres-data/base/1/2658
Binary file not shown.
Binary file added postgres-data/base/1/2659
Binary file not shown.
Binary file added postgres-data/base/1/2660
Binary file not shown.
Binary file added postgres-data/base/1/2661
Binary file not shown.
Binary file added postgres-data/base/1/2662
Binary file not shown.
Binary file added postgres-data/base/1/2663
Binary file not shown.
Binary file added postgres-data/base/1/2664
Binary file not shown.
Binary file added postgres-data/base/1/2665
Binary file not shown.
Binary file added postgres-data/base/1/2666
Binary file not shown.
Binary file added postgres-data/base/1/2667
Binary file not shown.
Binary file added postgres-data/base/1/2668
Binary file not shown.
Binary file added postgres-data/base/1/2669
Binary file not shown.
Binary file added postgres-data/base/1/2670
Binary file not shown.
Binary file added postgres-data/base/1/2673
Binary file not shown.
Binary file added postgres-data/base/1/2674
Binary file not shown.
Binary file added postgres-data/base/1/2675
Binary file not shown.
Binary file added postgres-data/base/1/2678
Binary file not shown.
Binary file added postgres-data/base/1/2679
Binary file not shown.
Binary file added postgres-data/base/1/2680
Binary file not shown.
Binary file added postgres-data/base/1/2681
Binary file not shown.
Binary file added postgres-data/base/1/2682
Binary file not shown.
Binary file added postgres-data/base/1/2683
Binary file not shown.
Binary file added postgres-data/base/1/2684
Binary file not shown.
Binary file added postgres-data/base/1/2685
Binary file not shown.
Binary file added postgres-data/base/1/2686
Binary file not shown.
Binary file added postgres-data/base/1/2687
Binary file not shown.
Binary file added postgres-data/base/1/2688
Binary file not shown.
Binary file added postgres-data/base/1/2689
Binary file not shown.
Binary file added postgres-data/base/1/2690
Binary file not shown.
Binary file added postgres-data/base/1/2691
Binary file not shown.
Binary file added postgres-data/base/1/2692
Binary file not shown.
Binary file added postgres-data/base/1/2693
Binary file not shown.
Binary file added postgres-data/base/1/2696
Binary file not shown.
Binary file added postgres-data/base/1/2699
Binary file not shown.
Binary file added postgres-data/base/1/2701
Binary file not shown.
Binary file added postgres-data/base/1/2702
Binary file not shown.
Binary file added postgres-data/base/1/2703
Binary file not shown.
Binary file added postgres-data/base/1/2704
Binary file not shown.
Binary file added postgres-data/base/1/2753
Binary file not shown.
Binary file added postgres-data/base/1/2753_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2753_vm
Binary file not shown.
Binary file added postgres-data/base/1/2754
Binary file not shown.
Binary file added postgres-data/base/1/2755
Binary file not shown.
Binary file added postgres-data/base/1/2756
Binary file not shown.
Binary file added postgres-data/base/1/2757
Binary file not shown.
Empty file added postgres-data/base/1/2830
Empty file.
Binary file added postgres-data/base/1/2831
Binary file not shown.
Empty file added postgres-data/base/1/2832
Empty file.
Binary file added postgres-data/base/1/2833
Binary file not shown.
Empty file added postgres-data/base/1/2834
Empty file.
Binary file added postgres-data/base/1/2835
Binary file not shown.
Binary file added postgres-data/base/1/2836
Binary file not shown.
Binary file added postgres-data/base/1/2836_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2836_vm
Binary file not shown.
Binary file added postgres-data/base/1/2837
Binary file not shown.
Binary file added postgres-data/base/1/2838
Binary file not shown.
Binary file added postgres-data/base/1/2838_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2838_vm
Binary file not shown.
Binary file added postgres-data/base/1/2839
Binary file not shown.
Binary file added postgres-data/base/1/2840
Binary file not shown.
Binary file added postgres-data/base/1/2840_fsm
Binary file not shown.
Binary file added postgres-data/base/1/2840_vm
Binary file not shown.
Binary file added postgres-data/base/1/2841
Binary file not shown.
Empty file added postgres-data/base/1/2995
Empty file.
Binary file added postgres-data/base/1/2996
Binary file not shown.
Binary file added postgres-data/base/1/3079
Binary file not shown.
Binary file added postgres-data/base/1/3079_fsm
Binary file not shown.
Binary file added postgres-data/base/1/3079_vm
Binary file not shown.
Binary file added postgres-data/base/1/3080
Binary file not shown.
Binary file added postgres-data/base/1/3081
Binary file not shown.
Binary file added postgres-data/base/1/3085
Binary file not shown.
Empty file added postgres-data/base/1/3118
Empty file.
Binary file added postgres-data/base/1/3119
Binary file not shown.
Binary file added postgres-data/base/1/3164
Binary file not shown.
Empty file added postgres-data/base/1/3256
Empty file.
Binary file added postgres-data/base/1/3257
Binary file not shown.
Binary file added postgres-data/base/1/3258
Binary file not shown.
Empty file added postgres-data/base/1/3350
Empty file.
Binary file added postgres-data/base/1/3351
Binary file not shown.
Binary file added postgres-data/base/1/3379
Binary file not shown.
Binary file added postgres-data/base/1/3380
Binary file not shown.
Empty file added postgres-data/base/1/3381
Empty file.
Binary file added postgres-data/base/1/3394
Binary file not shown.
Binary file added postgres-data/base/1/3394_fsm
Binary file not shown.
Binary file added postgres-data/base/1/3394_vm
Binary file not shown.
Binary file added postgres-data/base/1/3395
Binary file not shown.
Empty file added postgres-data/base/1/3429
Empty file.
Empty file added postgres-data/base/1/3430
Empty file.
Binary file added postgres-data/base/1/3431
Binary file not shown.
Binary file added postgres-data/base/1/3433
Binary file not shown.
Empty file added postgres-data/base/1/3439
Empty file.
Binary file added postgres-data/base/1/3440
Binary file not shown.
Binary file added postgres-data/base/1/3455
Binary file not shown.
Binary file added postgres-data/base/1/3456
Binary file not shown.
Binary file added postgres-data/base/1/3456_fsm
Binary file not shown.
Binary file added postgres-data/base/1/3456_vm
Binary file not shown.
Empty file added postgres-data/base/1/3466
Empty file.
Binary file added postgres-data/base/1/3467
Binary file not shown.
Binary file added postgres-data/base/1/3468
Binary file not shown.
Empty file added postgres-data/base/1/3501
Empty file.
Binary file added postgres-data/base/1/3502
Binary file not shown.
Binary file added postgres-data/base/1/3503
Binary file not shown.
Binary file added postgres-data/base/1/3534
Binary file not shown.
Binary file added postgres-data/base/1/3541
Binary file not shown.
Binary file added postgres-data/base/1/3541_fsm
Binary file not shown.
Binary file added postgres-data/base/1/3541_vm
Binary file not shown.
Binary file added postgres-data/base/1/3542
Binary file not shown.
Binary file added postgres-data/base/1/3574
Binary file not shown.
Binary file added postgres-data/base/1/3575
Binary file not shown.
Empty file added postgres-data/base/1/3576
Empty file.
Empty file added postgres-data/base/1/3596
Empty file.
Binary file added postgres-data/base/1/3597
Binary file not shown.
Empty file added postgres-data/base/1/3598
Empty file.
Binary file added postgres-data/base/1/3599
Binary file not shown.
Binary file added postgres-data/base/1/3600
Binary file not shown.
Binary file added postgres-data/base/1/3600_fsm
Binary file not shown.
Binary file added postgres-data/base/1/3600_vm
Binary file not shown.
Binary file added postgres-data/base/1/3601
Binary file not shown.
Binary file added postgres-data/base/1/3601_fsm
Binary file not shown.
Binary file added postgres-data/base/1/3601_vm
Binary file not shown.
Binary file added postgres-data/base/1/3602
Binary file not shown.
Binary file added postgres-data/base/1/3602_fsm
Binary file not shown.
Binary file added postgres-data/base/1/3602_vm
Binary file not shown.
Binary file added postgres-data/base/1/3603
Binary file not shown.
Binary file added postgres-data/base/1/3603_fsm
Binary file not shown.
Binary file added postgres-data/base/1/3603_vm
Binary file not shown.
Binary file added postgres-data/base/1/3604
Binary file not shown.
Binary file added postgres-data/base/1/3605
Binary file not shown.
Binary file added postgres-data/base/1/3606
Binary file not shown.
Binary file added postgres-data/base/1/3607
Binary file not shown.
Binary file added postgres-data/base/1/3608
Binary file not shown.
Binary file added postgres-data/base/1/3609
Binary file not shown.
Binary file added postgres-data/base/1/3712
Binary file not shown.
Binary file added postgres-data/base/1/3764
Binary file not shown.
Binary file added postgres-data/base/1/3764_fsm
Binary file not shown.
Binary file added postgres-data/base/1/3764_vm
Binary file not shown.
Binary file added postgres-data/base/1/3766
Binary file not shown.
Binary file added postgres-data/base/1/3767
Binary file not shown.
Binary file added postgres-data/base/1/3997
Binary file not shown.
Empty file added postgres-data/base/1/4143
Empty file.
Binary file added postgres-data/base/1/4144
Binary file not shown.
Empty file added postgres-data/base/1/4145
Empty file.
Binary file added postgres-data/base/1/4146
Binary file not shown.
Empty file added postgres-data/base/1/4147
Empty file.
Binary file added postgres-data/base/1/4148
Binary file not shown.
Empty file added postgres-data/base/1/4149
Empty file.
Binary file added postgres-data/base/1/4150
Binary file not shown.
Empty file added postgres-data/base/1/4151
Empty file.
Binary file added postgres-data/base/1/4152
Binary file not shown.
Empty file added postgres-data/base/1/4153
Empty file.
Binary file added postgres-data/base/1/4154
Binary file not shown.
Empty file added postgres-data/base/1/4155
Empty file.
Binary file added postgres-data/base/1/4156
Binary file not shown.
Empty file added postgres-data/base/1/4157
Empty file.
Binary file added postgres-data/base/1/4158
Binary file not shown.
Empty file added postgres-data/base/1/4159
Empty file.
Binary file added postgres-data/base/1/4160
Binary file not shown.
Empty file added postgres-data/base/1/4163
Empty file.
Binary file added postgres-data/base/1/4164
Binary file not shown.
Empty file added postgres-data/base/1/4165
Empty file.
Binary file added postgres-data/base/1/4166
Binary file not shown.
Empty file added postgres-data/base/1/4167
Empty file.
Binary file added postgres-data/base/1/4168
Binary file not shown.
Empty file added postgres-data/base/1/4169
Empty file.
Binary file added postgres-data/base/1/4170
Binary file not shown.
Empty file added postgres-data/base/1/4171
Empty file.
Binary file added postgres-data/base/1/4172
Binary file not shown.
Empty file added postgres-data/base/1/4173
Empty file.
Binary file added postgres-data/base/1/4174
Binary file not shown.
Binary file added postgres-data/base/1/5002
Binary file not shown.
Binary file added postgres-data/base/1/548
Binary file not shown.
Binary file added postgres-data/base/1/549
Binary file not shown.
Empty file added postgres-data/base/1/6102
Empty file.
Empty file added postgres-data/base/1/6104
Empty file.
Empty file added postgres-data/base/1/6106
Empty file.
Binary file added postgres-data/base/1/6110
Binary file not shown.
Binary file added postgres-data/base/1/6111
Binary file not shown.
Binary file added postgres-data/base/1/6112
Binary file not shown.
Binary file added postgres-data/base/1/6113
Binary file not shown.
Binary file added postgres-data/base/1/6116
Binary file not shown.
Binary file added postgres-data/base/1/6117
Binary file not shown.
Empty file added postgres-data/base/1/6175
Empty file.
Binary file added postgres-data/base/1/6176
Binary file not shown.
Empty file added postgres-data/base/1/6228
Empty file.
Binary file added postgres-data/base/1/6229
Binary file not shown.
Empty file added postgres-data/base/1/6237
Empty file.
Binary file added postgres-data/base/1/6238
Binary file not shown.
Binary file added postgres-data/base/1/6239
Binary file not shown.
Empty file added postgres-data/base/1/826
Empty file.
Binary file added postgres-data/base/1/827
Binary file not shown.
Loading
Loading