adding exercise for docker compose
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# Use the official MySQL image from Docker Hub
|
||||
FROM mysql:latest
|
||||
|
||||
# Set environment variables
|
||||
ENV MYSQL_ROOT_PASSWORD=root_password
|
||||
ENV MYSQL_DATABASE=employees
|
||||
|
||||
# Copy the SQL initialization script into the container
|
||||
COPY init.sql /docker-entrypoint-initdb.d/
|
||||
|
||||
# Expose port 3306 to allow external connections to the database
|
||||
EXPOSE 3306
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
CREATE DATABASE employees;
|
||||
USE employees;
|
||||
|
||||
|
||||
CREATE TABLE employee_data (
|
||||
Employee_Name VARCHAR(50),
|
||||
Title VARCHAR(50)
|
||||
);
|
||||
|
||||
|
||||
INSERT INTO employee_data
|
||||
(Employee_Name, Title)
|
||||
VALUES
|
||||
('Amit Khanna', 'Manager'),
|
||||
('Anjali Gupta', 'Engineer');
|
||||
Reference in New Issue
Block a user