diff --git a/client/Dockerfile b/client/Dockerfile index 6f8274e..a5a123d 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM node:20-slim as build +FROM docker://node:20-slim as build WORKDIR /app # Copy package files COPY package*.json ./ @@ -11,7 +11,7 @@ COPY . . RUN npm run build # Production stage -FROM nginx:alpine +FROM docker://nginx:alpine # Copy the built assets from build stage COPY --from=build /app/dist /usr/share/nginx/html # Expose port 80 diff --git a/docker-compose.yml b/docker-compose.yml index f2687b6..31798a7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,12 +4,10 @@ services: build: context: ./server dockerfile: Dockerfile - depends_on: - - mongodb ports: - "8000:8000" - networks: - - app-network + depends_on: + - mongodb environment: - MONGODB__DATABASE_NAME=quickgraph - MONGODB__URI=mongodb://root:example@mongodb:27017 @@ -17,31 +15,25 @@ services: client: image: quickgraph-client + ports: + - "3000:80" build: context: ./client dockerfile: Dockerfile - ports: - - "8080:80" depends_on: - server - docs - networks: - - app-network environment: - VITE_API_BASE_URL=http://localhost:8000/api - VITE_DOC_BASE_URL=http://localhost:4000 mongodb: - image: mongo:latest - ports: - - "27018:27017" + image: docker.io/mongo:latest volumes: - - mongodb_data:/data/db + - mongodb_data:/data/db:z environment: - MONGO_INITDB_ROOT_USERNAME=root - MONGO_INITDB_ROOT_PASSWORD=example - networks: - - app-network docs: build: @@ -51,13 +43,11 @@ services: - "4000:4000" volumes: - static_img:/app/static/img - networks: - - app-network depends_on: - init-static-img init-static-img: - image: curlimages/curl:latest + image: docker.io/curlimages/curl:latest user: root volumes: - static_img:/app/static/img @@ -91,11 +81,6 @@ services: chmod -R 755 /app/static/img && echo "Initialization complete" ' - volumes: mongodb_data: static_img: - -networks: - app-network: - driver: bridge diff --git a/server/Dockerfile b/server/Dockerfile index 89484e0..37731d6 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10-slim +FROM docker://python:3.10-slim WORKDIR /app