Skip to content

Instantly share code, notes, and snippets.

@System-Glitch
Last active July 23, 2021 07:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save System-Glitch/59a6e9e67783a29586eaa5a6dbfab3aa to your computer and use it in GitHub Desktop.
Save System-Glitch/59a6e9e67783a29586eaa5a6dbfab3aa to your computer and use it in GitHub Desktop.
Goyave development docker-compose
version: '3'
services:
api:
build: .
restart: always
networks:
- goyave-backend
ports:
- '8080:8080'
depends_on:
- mariadb
volumes:
- .:/app
mariadb:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: goyave
MYSQL_USER: goyave
MYSQL_PASSWORD: secret
networks:
- goyave-backend
restart: on-failure
volumes:
- databaseVolume:/var/lib/mysql
healthcheck:
test: ["CMD", 'mysqladmin ping']
interval: 10s
timeout: 10s
retries: 100
volumes:
databaseVolume: {}
networks:
goyave-backend:
driver: bridge
FROM golang:1.15-alpine
LABEL maintainer="Jérémy LAMBERT (SystemGlitch) <jeremy.la@outlook.fr>"
RUN apk update && apk upgrade && apk add --no-cache git openssh
RUN go get github.com/cespare/reflex
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
WORKDIR /app
EXPOSE 8080
CMD dockerize -wait tcp://mariadb:3306 reflex -s -- sh -c 'go run kernel.go'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment