Skip to content

Commit

Permalink
fix for dockerfile
Browse files Browse the repository at this point in the history
move docker-compose to separate folder
add 2 options for docker-compose
  • Loading branch information
liyaka committed Sep 15, 2024
1 parent 5b4e39f commit 3c0d878
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 14 deletions.
2 changes: 1 addition & 1 deletion apps/opik-backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ EXPOSE 3003
ARG OPIK_VERSION
ENV OPIK_VERSION=${OPIK_VERSION}

ENTRYPOINT ["./entrypoint.sh"]
CMD ["./entrypoint.sh"]
24 changes: 24 additions & 0 deletions deployment/docker-compose/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Run opik with docker-compose

## Installation Prerequisites for local installation

- Docker - https://docs.docker.com/engine/install/
- Docker Compose - https://docs.docker.com/compose/install/

## Run docker-compose using the latest images

From the root of the project

```bash
cd deployment/docker-compose
docker compose up -d
```

## Run docker-compose with building application from latest code

From the root of the project

```bash
cd deployment/docker-compose
docker compose -f docker-compose-build.yaml up -d --build
```
40 changes: 40 additions & 0 deletions deployment/docker-compose/docker-compose-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: opik

services:
mysql:
extends:
file: docker-compose.yaml
service: mysql

redis:
extends:
file: docker-compose.yaml
service: redis

clickhouse:
extends:
file: docker-compose.yaml
service: clickhouse

backend:
build:
context: ../../apps/opik-backend
dockerfile: Dockerfile
args:
OPIK_VERSION: latest
extends:
file: docker-compose.yaml
service: backend

frontend:
build:
context: ../../apps/opik-frontend
dockerfile: Dockerfile
args:
OPIK_VERSION: latest
extends:
file: docker-compose.yaml
service: frontend

networks:
default:
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,9 @@ services:
retries: 300

backend:
image: opik-backend
image: ghcr.io/comet-ml/opik/opik-backend:latest
platform: linux/amd64
hostname: backend
build:
context: ./apps/opik-backend
dockerfile: Dockerfile
args:
OPIK_VERSION: latest
command: ["bash", "-c", "./run_db_migrations.sh && ./entrypoint.sh"]
environment:
DOCKER_BUILDKIT: 1
Expand Down Expand Up @@ -90,13 +86,9 @@ services:
condition: service_healthy

frontend:
image: opik-frontend
image: ghcr.io/comet-ml/opik/opik-frontend:latest
platform: linux/amd64
hostname: frontend
build:
context: ./apps/opik-frontend
dockerfile: Dockerfile
args:
OPIK_VERSION: latest
ports:
- "5173:5173"
extra_hosts:
Expand All @@ -107,6 +99,5 @@ services:
backend:
condition: service_started


networks:
default:
File renamed without changes.
64 changes: 64 additions & 0 deletions deployment/docker-compose/nginx_default_local_full.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon application/javascript;
client_max_body_size 50M;
absolute_redirect off;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
set_real_ip_from 10.0.0.0/8;
rewrite_log on;
limit_req_log_level info;
limit_req_status 429;
map_hash_bucket_size 256;
resolver_timeout 3s;
server_tokens off;
proxy_socket_keepalive on;
proxy_http_version 1.1;
proxy_set_header Connection "";

log_format logger-json escape=json '{ "body_bytes_sent": $body_bytes_sent, "http_referer": "$http_referer", "http_user_agent": "$http_user_agent", "remote_addr": "$remote_addr", "remote_user": "$remote_user", "request": "$request", "status": $status, "time_local": "$time_local", "x_forwarded_for": "$http_x_forwarded_for" }';

access_log /dev/stdout logger-json;

server {
listen 5173 default_server;
server_name localhost;

location @api {
rewrite /api/(.*) /$1 break;
proxy_pass http://apihost:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

proxy_read_timeout 90;
proxy_connect_timeout 90;
proxy_send_timeout 90;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location ^~ /api/ {
try_files /dev/null @api;
}

location / {
alias /usr/share/nginx/html/;

try_files $uri $uri/ /index.html;

if ($uri = /index.html) {
add_header Cache-Control "no-cache";
}
}

}

0 comments on commit 3c0d878

Please sign in to comment.