Skip to content

Commit

Permalink
Add Docker Compose configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
AtilMohAmine committed Feb 10, 2024
1 parent 12e7c43 commit 7b93e27
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
1 change: 0 additions & 1 deletion client/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
.env
3 changes: 0 additions & 3 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ FROM node:20
# Set the working directory inside the container
WORKDIR /app

# Set environment variables
ENV REACT_APP_SERVER_URL=your_server_url

# Copy package.json and package-lock.json to the container
COPY package*.json ./

Expand Down
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3'

services:
chat-server:
build: ./server
env_file: ./server/.env
ports:
- "5000:5000"


chat-client:
build: ./client
env_file: ./client/.env
environment:
REACT_APP_SERVER_URL: http://chat-server:5000
ports:
- "3000:3000"
depends_on:
- chat-server
1 change: 0 additions & 1 deletion server/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules
.env
6 changes: 0 additions & 6 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ FROM node:20
# Set the working directory inside the container
WORKDIR /app

# Set environment variables
ENV PORT=your_port \
DATABASE_URI=your_database_uri \
ACCESS_TOKEN_SECRET=your_access_token_secret \
REFRESH_TOKEN_SECRET=your_refresh_token_secret

# Copy package.json and package-lock.json to the container
COPY package*.json ./

Expand Down

0 comments on commit 7b93e27

Please sign in to comment.