Skip to content

Docker integration #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea
*/.idea/*
spring-social/.java-version
spring-social/build.sh
react-social/package.json
react-social/yarn.lock
8 changes: 8 additions & 0 deletions db/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Derived from official mysql image (our base image)
FROM mysql
# Add a database
ENV MYSQL_DATABASE spring_social
# Add the content of the sql-scripts/ directory to your image
# All scripts in docker-entrypoint-initdb.d/ are automatically
# executed during container startup
#COPY ./sql-scripts/ /docker-entrypoint-initdb.d/
46 changes: 46 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
services:
react-social:
build:
context: ./react-social
dockerfile: Dockerfile
container_name: react-social
depends_on:
- spring-social
image: "react-social:latest"
ports:
- 3000:3000
spring-social:
build:
context: ./spring-social
dockerfile: Dockerfile
container_name: spring-social
depends_on:
- spring-social-db
environment:
- DATABASE_HOST=spring-social-db
- DATABASE_USER=root
- DATABASE_PASSWORD=passw0rd
- DATABASE_NAME=spring_social
- DATABASE_PORT=3306
- GOOGLE_CLIENT_ID=5014057553-8gm9um6vnli3cle5rgigcdjpdrid14m9.apps.googleusercontent.com
- GOOGLE_CLIENT_SECRET=tWZKVLxaD_ARWsriiiUFYoIk
image: spring-social
ports:
- 8080:8080
spring-social-db:
container_name: spring-social-db
environment:
MYSQL_DATABASE: spring_social
MYSQL_PASSWORD: spring-social-dev-passw0rd
MYSQL_ROOT_PASSWORD: passw0rd
MYSQL_USER: spring-social-dev
image: "mysql:latest"
ports:
- 3306:3306
restart: always
volumes:
- "db_data:/var/lib/mysql"
version: "3.8"
volumes:
db_data: {}
11 changes: 11 additions & 0 deletions react-social/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:alpine

WORKDIR /app

COPY package.json /app

RUN yarn install

COPY . /app

CMD ["yarn", "run", "start"]
Loading