Skip to content
Open
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
16 changes: 15 additions & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,24 @@ RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*

EXPOSE 5173
WORKDIR /app

# Store Deno cache outside /app so it survives volume mounts (enables offline operation)
ENV DENO_DIR=/deno-dir
ENV NODE_ENV=production

# Copy config files for dependency caching
COPY ./backend/deno.lock /app/deno.lock
COPY ./backend/deno.json /app/deno.json
RUN DENO_FUTURE=1 deno install --lock=deno.lock
COPY ./backend/package.json /app/package.json

# Install and cache all dependencies (both JSR and npm packages)
RUN DENO_FUTURE=1 deno install --lock=deno.lock --node-modules-dir=false

# Copy source files
COPY ./myceliasdk /myceliasdk
COPY ./backend . /app/

# Pre-cache all imports from the main entry point to ensure everything is available offline
RUN deno cache --lock=deno.lock server.ts

CMD ["deno", "run", "-A", "server.ts", "serve", "--prod"]
3 changes: 2 additions & 1 deletion backend/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"tasks": {
"dev": "deno run --watch -A server.ts serve"
"dev": "deno run --watch -A server.ts serve",
"dev:offline": "deno run --watch -A --node-modules-dir=false server.ts serve"
},
"lint": {
"rules": {
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:
limits:
cpus: '2.0'
memory: 4G

# mongo-search:
# image: mongodb/mongodb-community-search:latest
# entrypoint: ["/mongot-entrypoint.sh"]
Expand Down Expand Up @@ -64,13 +64,14 @@ services:
expose:
- "5173"
restart: always
command: deno task dev
command: deno task dev:offline
env_file:
- .env
environment:
REDIS_HOST: redis
REDIS_PORT: 6379
PYTHON_WORKER_URL: http://python-worker:8000
DENO_DIR: /deno-dir
volumes:
- ./backend:/app
- ./myceliasdk:/myceliasdk
Expand Down
Loading