Skip to content

Commit

Permalink
Fix client hotreload
Browse files Browse the repository at this point in the history
  • Loading branch information
malkhatib416 committed Oct 16, 2023
1 parent 73baa1a commit 54569cd
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 32 deletions.
4 changes: 2 additions & 2 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN yarn global add nodemon

RUN yarn install

EXPOSE 3000
EXPOSE 3010
EXPOSE 5173
EXPOSE 5174

CMD ["npm", "run", "dev"]
1 change: 1 addition & 0 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function App() {
};
fetchUsers();
}, []);

return (
<>
<div>
Expand Down
6 changes: 3 additions & 3 deletions client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import react from '@vitejs/plugin-react-swc';
export default defineConfig({
server: {
host: '0.0.0.0',
strictPort: true,
port: 5173,
watch: {
usePolling: true,
},
strictPort: true,
port: 5173,
hmr: {
host: '0.0.0.0',
port: 3010,
port: 5174,
},
},
plugins: [react()],
Expand Down
54 changes: 27 additions & 27 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
version: '3.4'

services:
db:
image: postgres
container_name: h3micro_db
restart: on-failure
volumes:
- ./db:/var/lib/postgresql/data
environment:
POSTGRES_USER: mohamad
POSTGRES_PASSWORD: 123321
# db:
# image: postgres
# container_name: h3micro_db
# restart: on-failure
# volumes:
# - ./db:/var/lib/postgresql/data
# environment:
# POSTGRES_USER: mohamad
# POSTGRES_PASSWORD: 123321

client:
build: ./client
container_name: h3micro_client
stdin_open: true
# stdin_open: true
ports:
- '5173:5173'
- '3010:3010'
- '5174:5174'
volumes:
- ./client:/usr/src/client
- /usr/src/client/node_modules
links:
- server
# links:
# - server
restart: on-failure

server:
build: ./server
container_name: h3micro_server
ports:
- '8000:8000'
volumes:
- ./server:/usr/src/server
- /usr/src/server/node_modules
links:
- db
environment:
PORT: 8000
POSTGRES_URI: postgres://mohamad:123321@db:5432/postgres
restart: on-failure
# server:
# build: ./server
# container_name: h3micro_server
# ports:
# - '8000:8000'
# volumes:
# - ./server:/usr/src/server
# - /usr/src/server/node_modules
# links:
# - db
# environment:
# PORT: 8000
# POSTGRES_URI: postgres://mohamad:123321@db:5432/postgres
# restart: on-failure

0 comments on commit 54569cd

Please sign in to comment.