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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target
data
.git
.idea
.vscode
.env
15 changes: 15 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM eclipse-temurin:17-jdk-jammy

RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY .mvn .mvn
COPY mvnw pom.xml ./
RUN chmod +x mvnw && ./mvnw dependency:go-offline

EXPOSE 8080 6891-6896 49001-49006/udp

CMD ["./mvnw", "spring-boot:run"]
42 changes: 42 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
services:
postgres:
image: postgres:15
container_name: filmexa-postgres
restart: always
env_file:
- ./.env
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- shared-network

backend:
image: mbaanni/filmexa-backend:${IMAGE_TAG:-latest}
container_name: filmexa-backend
restart: always
env_file:
- ./.env
environment:
JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true
volumes:
- movie_data:/data/movies
- image_data:/data/images
- subtitle_data:/data/subtitles
ports:
- "6891-6896:6891-6896/tcp"
- "49001-49006:49001-49006/udp"
depends_on:
- postgres
networks:
- shared-network

volumes:
postgres_data:
movie_data:
image_data:
subtitle_data:

networks:
shared-network:
external: true
name: filmexa-net
75 changes: 47 additions & 28 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,67 @@
name: filmexa-dev

services:

postgres:
image: postgres:15
container_name: filmexa-postgres
restart: always
env_file:
- ./.env

db:
image: postgres:15-alpine
environment:
POSTGRES_DB: filmexa_db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- shared-network

backend:
image: mbaanni/filmexa-backend:${IMAGE_TAG:-latest}
container_name: filmexa-backend
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d filmexa_db"]
interval: 5s
timeout: 5s
retries: 10

backend:
build:
context: .
dockerfile: Dockerfile.dev
env_file:
- ./.env
environment:
# Keep the Java torrent client on IPv4. Some cloud hosts advertise IPv6
# without providing a fully usable IPv6 route to DHT nodes and peers.
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/filmexa_db
SPRING_DATASOURCE_USERNAME: postgres
SPRING_DATASOURCE_PASSWORD: postgres
IMG_STORAGE_PATH: /data/images
VIDEO_STORAGE_PATH: /data/movies
JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true
ports:
- "8080:8080"
- "6891-6896:6891-6896/tcp"
- "49001-49006:49001-49006/udp"
volumes:
# Application storage must survive container recreation and redeployment.
- .:/app
- maven_cache:/root/.m2
- movie_data:/data/movies
- image_data:/data/images
- subtitle_data:/data/subtitles
depends_on:
db:
condition: service_healthy
restart: unless-stopped

frontend:
build:
context: ../frontend
dockerfile: Dockerfile.dev
ports:
- "6891-6896:6891-6896/tcp"
- "49001-49006:49001-49006/udp"
- "4200:4200"
volumes:
- ../frontend:/app
- frontend_node_modules:/app/node_modules
depends_on:
- postgres
networks:
- shared-network
- backend
restart: unless-stopped

volumes:
postgres_data:
maven_cache:
frontend_node_modules:
movie_data:
image_data:
subtitle_data:

networks:
shared-network:
external: true
name: filmexa-net
Loading