Skip to content

Instantly share code, notes, and snippets.

@ashmore11
Last active January 20, 2021 10:28
Show Gist options
  • Save ashmore11/027c3baad30bfc7c964be7aa43c838c8 to your computer and use it in GitHub Desktop.
Save ashmore11/027c3baad30bfc7c964be7aa43c838c8 to your computer and use it in GitHub Desktop.
Next Strapi Cloud Run (docker compose next.js)
version: "3.7"
services:
next-strapi-cloud-run-mysql:
image: mysql:5.7
container_name: next-strapi-cloud-run-mysql
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: cms
ports:
- "3308:3306"
next-strapi-cloud-run-cms:
image: strapi/strapi
container_name: next-strapi-cloud-run-cms
working_dir: /usr/src/cms
command: sh -c "yarn; yarn develop"
ports:
- "1337:1337"
depends_on:
- next-strapi-cloud-run-mysql
volumes:
- ./cms:/usr/src/cms
- /usr/src/cms/node_modules
environment:
- NODE_ENV=development
- DB_HOST=next-strapi-cloud-run-mysql
- DB_PORT=3306
- DB_NAME=cms
- DB_USERNAME=root
- DB_PASSWORD=password
next-strapi-cloud-run-app:
image: node:12-alpine
container_name: next-strapi-cloud-run-app
working_dir: /usr/src/app
command: sh -c "yarn; yarn dev"
ports:
- "3000:3000"
depends_on:
- next-strapi-cloud-run-cms
volumes:
- ./app:/usr/src/app
- /usr/src/app/node_modules
- /usr/src/app/.next
environment:
- NODE_ENV=development
- CMS_GRAPHQL_URL=http://next-strapi-cloud-run-cms:1337/graphql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment