提交 be73d281 编写于 作者: L llitfkitfk

add docker support

上级 eb03ccc2
web
\ No newline at end of file
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 []
\ No newline at end of file
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
\ No newline at end of file
node_modules
\ No newline at end of file
FROM node:lts-alpine AS builder
WORKDIR /home/app
COPY . .
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册