diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..f643fc0 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,24 @@ +services: + frontend: + env_file: + - ./frontend/.env + build: + context: ./frontend + dockerfile: DockerFile + args: + VITE_BACKEND_BASE_URL: ${VITE_BACKEND_BASE_URL} + ports: + - "3000:3000" + command: npm run build + develop: + watch: + - action: sync+restart + path: ./frontend + target: /app + networks: + - app-network + container_name: frontend + +networks: + app-network: + driver: bridge \ No newline at end of file diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..0a5f9af --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,6 @@ +node_modules +.git +.gitignore +.env +dist +*.log \ No newline at end of file diff --git a/frontend/DockerFile b/frontend/DockerFile new file mode 100644 index 0000000..5dfd407 --- /dev/null +++ b/frontend/DockerFile @@ -0,0 +1,18 @@ +FROM node:22 + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +ARG VITE_BACKEND_BASE_URL +ENV VITE_BACKEND_BASE_URL=$VITE_BACKEND_BASE_URL + +RUN npm run build + +EXPOSE 3000 + +CMD ["npm", "run", "build"] \ No newline at end of file