Skip to content

Instantly share code, notes, and snippets.

@karlisabele
Last active January 25, 2023 14:10
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save karlisabele/d0bebe3d27fc44a57d1db9a9abdff45a to your computer and use it in GitHub Desktop.
Save karlisabele/d0bebe3d27fc44a57d1db9a9abdff45a to your computer and use it in GitHub Desktop.
Simple openjdk and mysql docker set-up
version: "3"
services:
app:
build:
dockerfile: Dockerfile
context: .
database:
image: mysql:5.7
volumes:
- mysql:/var/lib/mysql
- ./dump.sql:/docker-entrypoint-initdb.d/1-dump.sql
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_DATABASE: qwerty
MYSQL_USER: qwerty
MYSQL_PASSWORD: qwerty
volumes:
mysql:
FROM openjdk:8u201-jdk-alpine3.9
RUN apk update && apk add mysql-client && rm -f /var/cache/apk/*
ENTRYPOINT ["sh"]
CMD ["-c" , "tail -f /dev/null"]
SELECT 1 + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment