Skip to content

Commit

Permalink
First dockerized build version
Browse files Browse the repository at this point in the history
  • Loading branch information
jfontan committed Jul 15, 2021
1 parent 9e5cac6 commit 3692549
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.16 AS builder

ENV GOPATH /go
RUN apt-get update && \
apt-get install -y libsqlite3-0 libsqlite3-dev

WORKDIR /build
COPY . .

RUN go build -v ./server/cmd/glslsandbox

FROM debian:buster-slim

EXPOSE 8888
COPY --from=builder /build/ /glslsandbox/
ENTRYPOINT [ "/glslsandbox/entrypoint.sh" ]
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.9"
services:
glslsandbox:
image: glslsandbox
volumes:
- ./data:/data
ports:
- "3000:8888"
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

cd glslsandbox
DATA_PATH=/data ./glslsandbox
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func New(s store.Store, dataPath string) *Server {

func (s *Server) Start() error {
s.setup()
return s.echo.Start("localhost:8888")
return s.echo.Start(":8888")
}

func (s *Server) setup() {
Expand Down

0 comments on commit 3692549

Please sign in to comment.