-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
60 lines (60 loc) · 1.68 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2020
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
version: "3.7"
services:
init:
restart: on-failure
image: electrocucaracha/pkg_mgr-init
build:
context: ./
environment:
PKG_DB_HOSTNAME: mariadb
PKG_SQL_ENGINE: mysql
PKG_DB_USERNAME: "${DB_USERNAME}"
PKG_DB_PASSWORD: "${DB_PASSWORD}"
PKG_DB_DATABASE: "${DB_NAME}"
PKG_SCRIPTS_PATH: /pkg/src
PKG_MAIN_FILE: /pkg/install.sh
volumes:
- ../:/pkg:ro
depends_on:
- mariadb
command:
- init
api:
restart: on-failure
image: electrocucaracha/pkg_mgr:latest
environment:
PKG_DB_HOSTNAME: mariadb
PKG_SQL_ENGINE: mysql
PKG_DB_USERNAME: "${DB_USERNAME}"
PKG_DB_PASSWORD: "${DB_PASSWORD}"
PKG_DB_DATABASE: "${DB_NAME}"
depends_on:
- init
ports:
- 3000:3000
command:
- serve
mariadb:
image: mariadb:10.1.38
restart: always
healthcheck:
test: ["CMD", "/usr/bin/mysql", "-psecure", "-e'SHOW DATABASES;'"]
interval: 5s
timeout: 1s
start_period: 10s
retries: 10
environment:
MYSQL_ROOT_PASSWORD: "secure"
MYSQL_USER: "${DB_USERNAME}"
MYSQL_PASSWORD: "${DB_PASSWORD}"
MYSQL_DATABASE: "${DB_NAME}"
volumes:
- ./logs/:/var/log/mysql/