Skip to content

Instantly share code, notes, and snippets.

@Tymek
Created July 14, 2022 07:51
Show Gist options
  • Save Tymek/7563756e847e11ff4bdb439ed0fd0ff6 to your computer and use it in GitHub Desktop.
Save Tymek/7563756e847e11ff4bdb439ed0fd0ff6 to your computer and use it in GitHub Desktop.
uhp
version: '3'
services:
mysql:
image: docker.io/bitnami/mysql:8.0
volumes:
- ./mysql_data:/bitnami/mysql
environment:
- ALLOW_EMPTY_PASSWORD=yes
- MYSQL_USER=bn_wordpress
- MYSQL_DATABASE=bitnami_wordpress
wordpress:
image: docker.io/bitnami/wordpress:6
ports:
- '80:8080'
- '443:8443'
volumes:
- ./wordpress_data:/bitnami/wordpress
depends_on:
- mysql
environment:
- ALLOW_EMPTY_PASSWORD=yes
- WORDPRESS_DATABASE_HOST=mysql
- WORDPRESS_DATABASE_PORT_NUMBER=3306
- WORDPRESS_DATABASE_USER=bn_wordpress
- WORDPRESS_DATABASE_NAME=bitnami_wordpress
localstack:
container_name: "${LOCALSTACK_DOCKER_NAME-unleash_homepage_localstack_main}"
image: localstack/localstack
ports:
- "127.0.0.1:4566:4566"
- "127.0.0.1:4510-4559:4510-4559"
environment:
- DEBUG=${DEBUG-}
- PERSISTENCE=${PERSISTENCE-}
- LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-}
- DOCKER_HOST=unix:///var/run/docker.sock
volumes:
- ./localstack:/var/lib/localstack
- "/var/run/docker.sock:/var/run/docker.sock"
mkdir mysql_data
mkdir wordpress_data
mkdir localstack
chmod 777 mysql_data
chmod 777 wordpress_data
chmod 777 localstack
git clone git@github.com:Unleash/homepage-backend.git backend
git clone git@github.com:Unleash/homepage-frontend.git frontend
sudo docker-compose pull
echo "SITE_URL=localhost:3000" > ./frontend/.env.local
echo "WORDPRESS_PREVIEW_SECRET=localhost" >> ./frontend/.env.local
echo "NEXT_PUBLIC_WORDPRESS_GRAPHQL_ENDPOINT=https://localhost:80/" >> ./frontend/.env.local
# - `NEXT_PUBLIC_WORDPRESS_GRAPHQL_ENDPOINT` - Absolute URL of the WordPress instance's GraphQL endpoint, used for fetching the CMS data at build time and for client side AJAX requests on Blog archives.
# - `NEXT_PUBLIC_GOOGLE_TAG_MANAGER` - Google Tag Manager ID used by the frontend tracking snippet.
# - `NEXT_PUBLIC_GOOGLE_ANALYTICS` - Google Analytics ID used by used by the frontend tracking snippet.
# - `SITE_URL` - Public URL of the frontend, used by the `next-sitemap` config to generate correct sitemap URLs.
# - `WORDPRESS_PREVIEW_SECRET` - Shared token used to enable NextJS preview mode when making CMS edits, this must match the value of `UNLEASH_FRONTEND_PREVIEW_SECRET` in WordPress `wp-config.php` on the backend.
# TODO: install and build
# (cd backend && yarn && yarn postversion)
# (cd frontend && yarn && yarn build)
sudo docker-compose up -d
# TODO: configure S3 bucket
sudo docker-compose exec localstack bash -c "pwd; ls -alh"
###
echo "\n### SETUP DONE ###"
echo "Login to http://localhost:80/login with user:bitnami"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment