diff --git a/docker-compose.yml b/docker-compose.yml index adb5d45..1845bea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,20 @@ services: - www-dev: - image: node:20-alpine - container_name: www-local-ai - working_dir: /app + web: + image: nginx:alpine + container_name: www-ai + restart: always + healthcheck: + test: ["CMD", "wget", "--spider", "-q", "http://localhost:80/"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 10s volumes: - - ./src:/app - - node_modules:/app/node_modules - ports: - - "6173:5173" - command: sh -c "npm install && npm run dev -- --hostname 0.0.0.0" + - ./html:/usr/share/nginx/html + - ./nginx.conf:/etc/nginx/conf.d/default.conf networks: - - devnet - -volumes: - node_modules: + - webnet networks: - devnet: - driver: bridge + webnet: + external: true diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..4d97d59 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,12 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri.html $uri/ /index.html; + } + + error_page 404 /404.html; +}