diff --git a/docker-compose.yml b/docker-compose.yml index d6d823c..bdd0ec4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,29 @@ +# Note that .env file will automatically populate +# variables in this file. +# If these variables are also set on the host system, +# those will be used over the .env file. +# See https://vsupalov.com/docker-arg-env-variable-guide/ + +x-common-environment: &common-server-environment + APNS_IS_PRODUCTION: ${APNS_IS_PRODUCTION} + APNS_BUNDLE_ID: ${APNS_BUNDLE_ID} + APNS_TEAM_ID: ${APNS_TEAM_ID} + APNS_KEY_ID: ${APNS_KEY_ID} + APNS_PRIVATE_KEY: ${APNS_PRIVATE_KEY} + services: dev: build: . command: npm run start:dev ports: - "4000:4000" - env_file: .env depends_on: - redis + environment: + <<: *common-server-environment volumes: - .:/usr/src/app - # Note that neither app-integration-test or test modes require env variables, - # need to find a way to pass variables without .env if this changes - app-integration-test: build: . command: npm run start:dev integration-testing @@ -20,6 +31,9 @@ services: - "4000:4000" depends_on: - redis + environment: + <<: *common-server-environment + volumes: - .:/usr/src/app @@ -28,6 +42,9 @@ services: command: npm run test depends_on: - redis + environment: + <<: *common-server-environment + volumes: - .:/usr/src/app redis: