Skip to content

Commit

Permalink
containerize backend app
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleehak committed Apr 11, 2024
1 parent c7b9fb5 commit a1f8432
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM openjdk:17-jdk-slim

RUN apt-get update && apt-get install -y \
python3 \
wget \
curl \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*

RUN wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O /usr/local/bin/yt-dlp && \
chmod a+rx /usr/local/bin/yt-dlp

WORKDIR /app
COPY . /app

COPY backend/target/briefme-0.0.1-SNAPSHOT.jar briefme-0.0.1-SNAPSHOT.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","briefme-0.0.1-SNAPSHOT.jar"]
21 changes: 21 additions & 0 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter</artifactId>
<version>1.2.8.RELEASE</version>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down Expand Up @@ -74,6 +79,22 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>appengine-maven-plugin</artifactId>
<version>2.7.0</version>
<configuration>
<deploy.projectId>artful-lane-419217</deploy.projectId>
<deploy.stopPreviousVersion>true</deploy.stopPreviousVersion>
<deploy.version>1-0</deploy.version>
<cloudSdkHome>/Users/maleehakhalid/Downloads/google-cloud-sdk</cloudSdkHome>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.7.v20160115</version>
</plugin>
</plugins>
</build>

Expand Down
12 changes: 12 additions & 0 deletions backend/src/main/appengine/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
runtime: java
env: flex
runtime_config:
operating_system: "ubuntu22"
runtime_version: "17"
env_variables:
SPRING_PROFILES_ACTIVE: "gcp"
handlers:
- url: /.*
script: this field is required, but ignored
manual_scaling:
instances: 1
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ public String extractAudio(String inputVideoFile) {

try {
String[] command = {
"youtube-dl",
"yt-dlp",
"--extract-audio",
"--verbose",
"--default-search",
defaultSearch,
"--audio-format",
Expand Down

0 comments on commit a1f8432

Please sign in to comment.