Skip to content

Instantly share code, notes, and snippets.

@xinyii
Created May 8, 2021 06:11
Show Gist options
  • Save xinyii/706541c43812777153ed073adf586b2b to your computer and use it in GitHub Desktop.
Save xinyii/706541c43812777153ed073adf586b2b to your computer and use it in GitHub Desktop.
[Docker deploy back-end] #docker
version: '3.1'
services:
server:
container_name: server
build: .
image: server
ports:
- 8080:8080
restart: always
depends_on:
- db
web:
container_name: web
build:
context: ../web
dockerfile: ../web/Dockerfile
image: web
ports:
- 80:80
restart: always
depends_on:
- server
db:
container_name: db
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
mysql_adminer:
container_name: db_adminer
image: adminer
restart: always
ports:
- 8081:8080
FROM openjdk:11-jre
WORKDIR /usr/src/app
EXPOSE 8080
COPY ./build/install/<project> .
ENTRYPOINT ["sh","./bin/<project>", "--spring.profiles.active=edge"]
HEALTHCHECK --start-period=30s --interval=30s --timeout=3s --retries=3 \
CMD curl --silent --fail --request GET http://localhost:8080/swagger-ui.html || exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment