- Docker
- Remote MySQL > v8.* (Update docker-compose file and api/.env to use local MySQL db)
- Next.js 11
- Strapi 5
- MySQL v8
- AWS s3
- Sendgrid
Clone this repository and change directory
cd store
From the root project directory:
-
Navigate to the
api
directory:cd api
-
Copy the example environment variables file:
cp .env.example .env
-
Update the environment variables in the
.env
file as needed.
Note for API Server:
-
You can change the default random base64 from the example environment variable:
openssl rand -base64 16
-
This project uses AWS S3 to store assets (product images). Ensure that Bucket ACLs are enabled and the bucket policy is set to public.
-
For images/media hosted on a different domain, add the domain inside the
contentSecurityPolicy.directives
in theapi/config/middlewares.js
file.
From the root project directory:
-
Navigate to the
app
directory:cd app
-
Copy the example environment variables file:
cp .env.local.example .env.local
-
Update the environment variables in the
.env.local
file as needed.
Note for App Server:
- If you are using an image source URL hosted on a different domain, add your image source hostname to
next.config.js
inside theapp
directory. For more details, refer to this discussion.
From the root project directory:
docker-compose up
- Navigate to http://localhost:3005/ for the client-side app.
- Navigate to http://localhost:1337/admin for the admin site.
Use Dev Container
VS Code extension to use docker container as a full-featured development environment.
https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
cd store
docker-compose -f docker-compose.prod.yml up