add docker support
This commit is contained in:
parent
eb03ccc271
commit
be73d2810f
|
@ -0,0 +1 @@
|
|||
web
|
|
@ -0,0 +1,24 @@
|
|||
FROM golang:alpine AS builder
|
||||
RUN apk add --no-cache git
|
||||
WORKDIR /home/app
|
||||
|
||||
# comment this if using vendor
|
||||
# ENV GOPROXY=https://mod.gokit.info
|
||||
# COPY go.mod go.sum ./
|
||||
# RUN go mod download
|
||||
|
||||
COPY . .
|
||||
ENV GOPROXY=https://mod.gokit.info
|
||||
RUN go build -o ./bin/monapi src/modules/monapi/monapi.go
|
||||
|
||||
FROM alpine:3.10
|
||||
LABEL maintainer="llitfkitfk@gmail.com"
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /home/app/etc /app/etc
|
||||
COPY --from=builder /home/app/bin /usr/local/bin
|
||||
|
||||
# ENTRYPOINT []
|
||||
# CMD []
|
|
@ -0,0 +1,38 @@
|
|||
version: "3"
|
||||
volumes:
|
||||
mysql-data:
|
||||
services:
|
||||
api:
|
||||
build: .
|
||||
image: api
|
||||
|
||||
monapi:
|
||||
image: api
|
||||
restart: always
|
||||
command: monapi
|
||||
|
||||
web:
|
||||
build:
|
||||
context: web
|
||||
restart: always
|
||||
ports:
|
||||
- 8010:8010
|
||||
|
||||
redis:
|
||||
image: redis
|
||||
restart: always
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
restart: always
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=1234
|
||||
ports:
|
||||
- 3306:3306
|
||||
volumes:
|
||||
- ./sql:/docker-entrypoint-initdb.d
|
||||
- mysql-data:/var/lib/mysql
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
node_modules
|
|
@ -0,0 +1,5 @@
|
|||
FROM node:lts-alpine AS builder
|
||||
|
||||
WORKDIR /home/app
|
||||
|
||||
COPY . .
|
Loading…
Reference in New Issue