1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Added Docker fixes issue #5

This commit is contained in:
robrotheram 2019-10-07 23:41:00 +01:00
parent 12b3bec2f6
commit 6a87b1d262
3 changed files with 53 additions and 0 deletions

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM golang:alpine AS build-env
ADD . /src
RUN cd /src && go build -o wakapi
# final stage
FROM alpine
WORKDIR /app
COPY --from=build-env /src/wakapi /app/
COPY --from=build-env /src/config.ini /app/
COPY --from=build-env /src/.env.example /app/.env
RUN sed -i 's/listen = 127.0.0.1/listen = 0.0.0.0/g' /app/config.ini
ADD static /app/static
ADD wait-for-it.sh .
ENTRYPOINT ./wait-for-it.sh

35
docker-compose.yml Normal file
View File

@ -0,0 +1,35 @@
version: "3.1"
services:
wakapi:
image: wakapi:latest
build:
dockerfile: Dockerfile
context: .
container_name: wakapi
environment:
- WAKAPI_DB_USER=wakapi
- WAKAPI_DB_PASSWORD=supersecretpassword
- WAKAPI_DB_HOST=wakapi_db
- WAKAPI_DB_NAME=wakapi_db
ports:
- "3000:3000"
depends_on:
- wakapi_db
wakapi_db:
image: linuxserver/mariadb
container_name: wakapi_db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=rootpass
- TZ=Europe/London
- MYSQL_DATABASE=wakapi_db
- MYSQL_USER=wakapi
- MYSQL_PASSWORD=supersecretpassword
restart: unless-stopped
ports:
- "3306:3306"

4
wait-for-it.sh Executable file
View File

@ -0,0 +1,4 @@
echo "Waiting 10 Seconds for DB to start"
sleep 10;
echo "Starting Application"
./wakapi