Skip to content

Commit

Permalink
Merge pull request #2 from ptitloup/insee-compose
Browse files Browse the repository at this point in the history
[DONE] add compose dev to use docker as dev contener environement, add host …
  • Loading branch information
garronej authored Oct 29, 2024
2 parents 88cef8a + 9d92f60 commit eb5518d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Compose
.env-compose

# Logs
logs
*.log
Expand Down
24 changes: 24 additions & 0 deletions compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
x-react-volumes: &react-volumes
- ./:/opt/app

services:
front:
container_name: reactapp
image: node:20
hostname: front
profiles:
- dev
volumes: *react-volumes
tty: true
stdin_open: true # without this node doesn't start
working_dir: /opt/app
ports:
- 3000:3000 # use by react
- 5173:5173 # use by vite
env_file: ".env-compose"
environment:
WATCHPACK_POLLING: true
FAST_REFRESH: false
HTTP_PROXY: ${HTTP_PROXY}
HTTPS_PROXY: ${HTTPS_PROXY}
NO_PROXY: ${NO_PROXY}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"postinstall": "vite-envs update-types",
"dev": "vite",
"dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
Expand Down

0 comments on commit eb5518d

Please sign in to comment.