Create a .env
file and insert the variables below
REACT_APP_SERVER_URL
: URL of the serverREACT_APP_AUTH0_DOMAIN
: Issuer domain for Auth0REACT_APP_AUTH0_CLIENT_ID
: Client id of a application of Auth0REACT_APP_AUTH0_AUDIENCE
: Audience scope for Auth0
We can use the following script in order to build and run the image locally:
Create a file docker-build.sh
and paste the script remplazing the ENV VARS with the
values in .env
file
NOTE: THIS FILE SHOULD NOT BE ADDED TO GIT
docker build .\
--build-arg REACT_APP_SERVER_URL="REACT_APP_SERVER_URL"\
--tag slingercode-drive-client:$(git log -1 --format=%h) &&
docker run --name slingercode-drive-client -d -p 80:80 slingercode-drive-client:$(git log -1 --format=%h)
In order to facilitate the build and execution of the client and server images,
we can create a docker-compose.yml
file in a general context of the
two repositories:
.
├── .env
├── client
│ └── Dockerfile
├── docker-compose.yml
└── server
└── Dockerfile
To help this process, a .env
file must be created with both versions, the server and the client
NOTE: Both client and server repositories has the same docker-compose.yml
version, and is only for development purpose