Skip to content
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
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ POSTGRES_DB=findfirst
SPRING_PROFILES_ACTIVE=dev
SPRING_DATASOURCE_USERNAME=${POSTGRES_USER}
SPRING_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD}
SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/findfirst
SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/findfirst
SCREENSHOT_SERVICE_URL=http://screenshot:8080/
TYPESENSE_SERVICE_HOST=typesense
TYPESENSE_API_KEY=xyz
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ ifeq ( ,$(wildcard $(CERT_FILE)))
@echo ">Creating certificates"
cd ./server/scripts && ./createServerKeys.sh
endif
cd ./server && ./gradlew clean build
cd ./server && ./gradlew clean build $(args)
docker build -t ghcr.io/r-sandor/findfirst-server -f ./docker/server/Dockerfile.buildlocal ./server

build_screenshot:
cd ./screenshot && ./gradlew clean build
cd ./screenshot && ./gradlew clean build $(args)
docker build -t ghcr.io/r-sandor/findfirst-screenshot -f ./docker/screenshot/Dockerfile.buildlocal ./screenshot

build_frontend:
Expand Down
3 changes: 3 additions & 0 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ services:
- SPRING_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD}
- SCREENSHOT_SERVICE_URL=http://screenshot:8080/
- FINDFIRST_SCREENSHOT_LOCATION=/app/screenshots
- FINDFIRST_TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
- FINDFIRST_TYPESENSE_HOST=${TYPESENSE_SERVICE_HOST}
volumes:
- ./server/prod.yml:/app/prod.yml
- ./data/screenshots:/app/screenshots
depends_on:
- db
- typesense
restart: always
screenshot:
build:
Expand Down
48 changes: 0 additions & 48 deletions docker-compose-staging.yml

This file was deleted.

9 changes: 7 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ services:
- SCREENSHOT_SERVICE_URL=${SCREENSHOT_SERVICE_URL}
- FINDFIRST_SCREENSHOT_LOCATION=/app/screenshots
- FINDFIRST_UPLOAD_LOCATION=/app/profile-pictures/
- FINDFIRST_TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
- FINDFIRST_TYPESENSE_HOST=${TYPESENSE_SERVICE_HOST}
volumes:
- ./data/screenshots:/app/screenshots
- ./data/uploads/profile-pictures:/app/profile-pictures
depends_on:
- db
- typesense
screenshot:
image: ghcr.io/r-sandor/findfirst-screenshot:latest
ports:
- "8080:8080"
- 8080:8080
environment:
- SPRING_PROFILES_ACTIVE=dev
- FINDFIRST_SCREENSHOT_LOCATION=/app/screenshots
Expand All @@ -34,7 +39,7 @@ services:
image: typesense/typesense:27.1
restart: on-failure
ports:
- "8108:8108"
- 8108:8108
environment:
- TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
@Slf4j
public class TypesenseConfiguration {

@Value("${typesense_api_key}")
@Value("${findfirst.typesense.api_key}")
String typesSenseApiKey;

@Value("${findfirst.typesense.host}")
String host;

@Bean
public Client typesenseClient() {
List<Node> nodes = new ArrayList<>();
nodes.add(new Node("http", // For Typesense Cloud use https
"localhost", // For Typesense Cloud use xxx.a1.typesense.net
"8108" // For Typesense Cloud use 443
));
nodes.add(new Node("http", host, "8108"));
org.typesense.api.Configuration configuration =
new org.typesense.api.Configuration(nodes, Duration.ofSeconds(9), typesSenseApiKey);
return new Client(configuration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down
3 changes: 0 additions & 3 deletions server/src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ logging.level.org.springframework.jdbc=ERROR
# SQL Settings
spring.sql.init.mode=never


# Postgres connect settings
spring.datasource.url=jdbc:postgresql://localhost:5432/findfirst
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.username=postgres
spring.datasource.password=admin


spring.config.import=optional:file:/app/prod.yml
Expand Down
3 changes: 2 additions & 1 deletion server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ findfirst.local.screenshot=../data/screenshots
findfirst.screenshot.location=${FINDFIRST_SCREENSHOT_LOCATION:${findfirst.local.screenshot}}
findfirst.app.frontend-url=${FINDFIRST_APP_FRONTEND-URL:http://localhost:3000/}
findfirst.app.domain=localhost
typesense_api_key=${TYPESENSE_API_KEY:xyz}
findfirst.typesense.api_key=${TYPESENSE_API_KEY:xyz}
findfirst.typesense.host=${FINDFIRST_TYPESENSE_HOST:localhost}

findfirst.upload.allowed-types=image/jpeg,image/png
findfirst.local.upload.profile-pictures=../data/uploads/profile-pictures/
Expand Down
Loading