Skip to content

Commit 751c807

Browse files
Initial commit
0 parents  commit 751c807

File tree

6 files changed

+734
-0
lines changed

6 files changed

+734
-0
lines changed

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# You can change this to a newer version of MySQL available at
2+
# https://hub.docker.com/r/mysql/mysql-server/tags/
3+
FROM mysql/mysql-server:8.0.24
4+
5+
COPY config/user.cnf /etc/mysql/my.cnf

LICENSE

+674
Large diffs are not rendered by default.

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# MySQL on Render
2+
3+
This is a template repository for running [MySQL](https://www.mysql.com) on Render.
4+
5+
* It uses the [official](https://hub.docker.com/r/mysql/mysql-server) MySQL Docker image.
6+
7+
* [Render Disks](https://render.com/docs/disks) provide fast, persistent SSD storage for your database.
8+
9+
* MySQL runs in your [private network](https://render.com/docs/private-services) and isn't exposed to the public Internet.
10+
11+
## MySQL Versions
12+
The `master` branch runs MySQL 8. You can use the `mysql-5` branch to run MySQL 5 instead.
13+
14+
## Deployment
15+
16+
See https://render.com/docs/deploy-mysql.

backups/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# You can change this to a newer version of MySQL available at
2+
# https://hub.docker.com/r/mysql/mysql-server/tags/
3+
FROM mysql/mysql-server:8.0.17
4+
5+
RUN mkdir -p /var/lib/mysql/backups
6+
7+
CMD mysqldump -h "$MYSQL_HOST" -u "$MYSQL_USER" --password="$MYSQL_PASSWORD" \
8+
--single-transaction \
9+
--result-file=/var/lib/mysql/backups/backup.$(date +%F.%T).sql \
10+
--all-databases

config/user.cnf

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[mysqld]
2+
# Needed for compatibility with existing SQL clients / WordPress.
3+
default-authentication-plugin=mysql_native_password
4+
5+
# Listen on all interfaces
6+
bind-address=0.0.0.0

render.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
services:
2+
- type: pserv
3+
name: mysql
4+
plan: standard
5+
env: docker
6+
disk:
7+
name: mysql
8+
mountPath: /var/lib/mysql
9+
sizeGB: 10
10+
envVars:
11+
- fromGroup: mysql
12+
13+
envVarGroups:
14+
- name: mysql
15+
envVars:
16+
- key: MYSQL_DATABASE
17+
value: mysql
18+
- key: MYSQL_USER
19+
value: mysql
20+
- key: MYSQL_PASSWORD
21+
generateValue: true
22+
- key: MYSQL_ROOT_PASSWORD
23+
generateValue: true

0 commit comments

Comments
 (0)