start multiple processes in same container
parent
feaf0cc0ba
commit
0c43f28cdc
|
@ -36,7 +36,7 @@ RUN npm install json-server --save-prod
|
|||
|
||||
WORKDIR /application
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 80 3001
|
||||
|
||||
CMD ["./start.sh"]
|
||||
#CMD ["sh", "-c", "node application/api/createMockDb.js && node application/api/apiServer.js && serve -s application/front -p 80"]
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
docker image build -t "react-redux-course:1.0.19" .
|
||||
docker run -p 5050:80 -it react-redux-course:1.0.19
|
||||
|
||||
Multiple ports:
|
||||
docker run -p 5050:80 -p 3001:3001 -it react-redux-course:1.0.20
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Start the first process
|
||||
./front/front.sh -D
|
||||
# Start the first process and put it in the background
|
||||
./front/front.sh -D &
|
||||
status=$?
|
||||
if [ $status -ne 0 ]; then
|
||||
echo "Failed to start front: $status"
|
||||
|
|
|
@ -27,7 +27,7 @@ module.exports = {
|
|||
new webpack.DefinePlugin({
|
||||
// This global makes sure React is built in prod mode.
|
||||
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
|
||||
"process.env.API_URL": JSON.stringify("http://localhost:3001")
|
||||
"process.env.API_URL": JSON.stringify("http://127.0.0.1:3001")
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
template: "src/index.html",
|
||||
|
|
Loading…
Reference in New Issue