Skip to content

Commit

Permalink
feat-#131 changed env files for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
LondheShubham153 committed Apr 18, 2024
1 parent 0914a41 commit f11ce8e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions backend/.env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
MONGODB_URI="mongodb://mongo/wanderlust"
REDIS_URL="redis://redis:6379"
4 changes: 2 additions & 2 deletions backend/.env.sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MONGODB_URI="mongodb://mongo/wanderlust"
REDIS_URL="redis://redis:6379"
MONGODB_URI="mongodb://127.0.0.1/wanderlust"
REDIS_URL="127.0.0.1:6379"
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ WORKDIR /app
# copy the above stage as compressed
COPY --from=backend-builder /app .

COPY .env.sample .env
COPY .env.docker .env

# Port
EXPOSE 5000
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
container_name: backend
build: ./backend
env_file:
- ./backend/.env.sample
- ./backend/.env.docker
ports:
- "5000:5000"
depends_on:
Expand All @@ -22,7 +22,7 @@ services:
container_name: frontend
build: ./frontend
env_file:
- ./frontend/.env.sample
- ./frontend/.env.docker
ports:
- "5173:5173"

Expand Down
1 change: 1 addition & 0 deletions frontend/.env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_PATH="http://3.142.151.217:5000"
2 changes: 1 addition & 1 deletion frontend/.env.sample
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_API_PATH="http://3.142.151.217:5000"
VITE_API_PATH="http://localhost:5000"
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ WORKDIR /app
COPY --from=frontend-builder /app .

# Copy the .env.sample file to .env.local
COPY .env.sample .env.local
COPY .env.docker .env.local

# Expose port 5173 for the Node.js application
EXPOSE 5173
Expand Down

0 comments on commit f11ce8e

Please sign in to comment.