diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..2f52dc2d564a9e5ea80d9cf80366cc977ec36154 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +/.git +/node_modules +/.pnp +.pnp.js +/build +/cicer +/test.db diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..f0c5742c0e91ab473ce5587f8965985c2c8d3851 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM golang as go_build + +WORKDIR /src/ +COPY main.go go.* /src/ +COPY api /src/api + +RUN CGO_ENABLED=1 go build -o cicer + + +FROM node as js_build + +WORKDIR /src/ +COPY *.json /src/ +COPY src /src/src +COPY public /src/public + +RUN npm install && npm run build + + +FROM debian + +ENV ASSETS_PATH="/assets" +ENV DB_PATH="/data/cicer.db" + +COPY --from=go_build /src/cicer /cicer +COPY --from=js_build /src/build /assets + +VOLUME /data + +ENTRYPOINT ["/cicer"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..5fee8ed89228f1ccb7c357f13663456f10dd8cca --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +cicer: + container_name: cicer + hostname: cicer + image: cicer + restart: always + user: 112:65534 + ports: + - "0.0.0.0:8080:8080" + volumes: + - /opt/cicer:/data + environment: + - SIGNKEY=<some-random-key> + - MAIL_SERVER= + - MAIL_ADDR= + - MAIL_PASS=