Skip to content

Commit bfe8b61

Browse files
committed
Added docker-compose-prod.yaml
1 parent ebedf65 commit bfe8b61

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docker-compose-prod.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: "3.8" # define the version of the Docker Compose file
2+
3+
services: # a 'dictionary' that defines the services that will run in containers
4+
prod: # a 'dictionary as the first 'key' in services; the 1st service, the dev env
5+
image: reactype/rt-prod # a 'key' in dev, specifying the image to use
6+
container_name: rt-prod # the container's name
7+
ports:
8+
- "5656:5656" # an 'array', maps port 8080 from the host to container
9+
# environment: # set ENV variables to MongoSQL initialization
10+
volumes: # a 'key' containing 'arrays'
11+
- .:/app/src # mounts the current directory to /usr/src/app in the container; allows webpack-dev-server running in the container to watch for code changes in our file system outside the container; we have live reloading and HMR
12+
- node_modules:/app/src/node_modules # mounts a named volume, 'node_modules', to preserve our node modules
13+
command: npm start # run 'npm run dev:hot' inside the container to start the server
14+
# depends_on: # ensures that the dev service/container starts only after postgres-db service/container is up
15+
# - postgres-db
16+
17+
# postgres-db: # a 'dictionary'; the 2nd service, the PostgreSQL db
18+
# image: spencerayleen:mm-postgres
19+
# container_name: mm-database
20+
# environment: # set ENV variables to PostgreSQL initialization
21+
# - POSTGRES_PASSWORD=admin # set user pw
22+
# - POSTGRES_USER=mmadmin # set user (name)
23+
# - POSTGRES_DB=mmdb # set db name
24+
# volumes:
25+
# - dev-db-volume:/var/lib/postgresql/data # mount a named volume, 'dev-db-volume', to the /var/lib/postgresql/data directory in the container where postgres stores the actual data files that make up your database; this volume will persist the data between container starts and stops
26+
27+
volumes: # a 'dictionary', defines named volumes to persist data
28+
node_modules: # empty node_modules key, will be shared between containers
29+
# dev-db-volume: # empty dev-db-volume key

0 commit comments

Comments
 (0)