Skip to content

Commit

Permalink
[DOCKER] Implemented docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislas Girard committed Jan 8, 2021
1 parent 1d2bb54 commit bfa093d
Show file tree
Hide file tree
Showing 18 changed files with 129 additions and 295 deletions.
2 changes: 1 addition & 1 deletion .docker/alpine/redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG REDIS_VERSION=${REDIS_VERSION:-"6"}

FROM redis:${REDIS_VERSION}-alpine
MAINTAINER Luc Michalski <[email protected]>


ARG REDIS_LOG_PREFIX_PATH=${REDIS_LOG_PREFIX_PATH:-"/var/log/redis"}

Expand Down
1 change: 0 additions & 1 deletion .docker/alpine/traefik/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG TRAEFIK_VERSION=${TRAEFIK_VERSION:-"v2.3.4"}

FROM traefik:${TRAEFIK_VERSION}
MAINTAINER Michalski Luc <[email protected]>

ARG TRAEFIK_LOG_PREFIX_PATH=${TRAEFIK_LOG_PREFIX_PATH:-"/var/log/traefik"}

Expand Down
16 changes: 8 additions & 8 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# General
NAMESPACE="seoz"
NAMESPACE="osat"
DEBUG="True"
AUTO_LETS_ENCRYPT=no
CURRENT_UID=""

# Server
DATABASE_ENGINE="mysql"
DATABASE_ENGINE="postgresql"
SECRET_KEY="=k!3##nty)rnp^(4wu=_kj(g7a)1rk80oymn52(we00z5y%ox=OP"
ALLOWED_HOSTS="http://dashboard:3000,http://server:8000,http://server:8080"
CORS_ALLOWED_ORIGINS=""
ALLOWED_HOSTS="http://localhost:8000"
CORS_ALLOWED_ORIGINS="http://dashboard:3000,http://server:8000,http://server:8080,http://localhost:3000"
REST_FRAMEWORK_PAGE_SIZE="20"
LANGUAGE_CODE=""
TIME_ZONE="UTC"
Expand All @@ -33,11 +33,11 @@ GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS="grafana-piechart-panel,vertamedia-cli

# MySQL
MYSQL_VERSION="10.5.6-r0"
MYSQL_DATABASE=seoz
MYSQL_DATABASE=osat
MYSQL_PASSWORD="da33ze45pM89T!"
MYSQL_PASSWORD_LENGTH=8
MYSQL_ROOT_PASSWORD="da33ze45pM89T!az79"
MYSQL_USER=seoz
MYSQL_USER=osat
MYSQL_DOMAIN="localhost"
MYSQL_PORT="3306"

Expand All @@ -46,9 +46,9 @@ NODE_VERSION="14"

# PostgreSQL
POSTGRES_VERSION="13"
POSTGRES_USER=seoz
POSTGRES_USER=osat
POSTGRES_PASSWORD="YOUR_POSTGRES_PASSWORD"
POSTGRES_DB=seoz
POSTGRES_DB=osat
POSTGRES_PORT="5432"

# ProtonVPN / Privoxy
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Seoz
# Osat


docker exec -it osat-server python manage.py createsuperuser


4 changes: 2 additions & 2 deletions admin/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
:80

root * /opt/seoz/www
root * /opt/osat/www
file_server

header Access-Control-Allow-Origin *
header Access-Control-Allow-Headers *
header Access-Control-Allow-Methods *

log {
output file /opt/seoz/logs/access.log
output file /opt/osat/logs/access.log
format single_field common_log
}
24 changes: 10 additions & 14 deletions admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG NODE_VERSION=${NODE_VERSION:-"14"}

FROM mhart/alpine-node:${NODE_VERSION} AS front-builder
MAINTAINER Michalski Luc <[email protected]>

# Import project's dependencies
WORKDIR /app
Expand All @@ -16,7 +15,6 @@ COPY . .
RUN yarn build

FROM caddy:2.3.0-rc.1-builder-alpine AS caddy-builder
MAINTAINER Michalski Luc <[email protected]>

ARG CADDY_VERSION=${CADDY_VERSION:-"v2.3.0-rc.1"}
ARG CADDY_PLUGINS=${CADDY_PLUGINS:-"cors,realip,expires,cache,gzip"}
Expand All @@ -32,7 +30,6 @@ RUN echo "VERSION=${CADDY_VERSION} PLUGINS=${CADDY_PLUGINS}" && \
VERSION=${CADDY_VERSION} PLUGINS=${CADDY_PLUGINS} ENABLE_TELEMETRY=false /bin/sh /usr/bin/caddy-builder

FROM alpine:3.12 AS runtime
MAINTAINER Michalski Luc <[email protected]>

# Set build arguments
ARG VERSION
Expand All @@ -41,15 +38,15 @@ ARG NOW

# Install runtime dependencies & create runtime user
RUN apk --no-cache --no-progress add ca-certificates openssl bash nano \
&& adduser -D seoz -h /opt/seoz -s /bin/sh \
&& su seoz -c 'cd /opt/seoz; mkdir -p www logs'
&& adduser -D osat -h /opt/osat -s /bin/sh \
&& su osat -c 'cd /opt/osat; mkdir -p www logs'

# Switch to user context
USER seoz
WORKDIR /opt/seoz
USER osat
WORKDIR /opt/osat

# Copy the virtual environment from the previous image
COPY --from=front-builder /app/build /opt/seoz/www
COPY --from=front-builder /app/build /opt/osat/www

# Install caddy
COPY --from=caddy-builder /usr/bin/caddy /usr/bin/caddy
Expand All @@ -59,21 +56,20 @@ COPY --from=caddy-builder /go/bin/parent /bin/parent

# Container configuration
EXPOSE 3000 80 443 2015
VOLUME /opt/seoz/www
VOLUME /opt/osat/www

# Set container labels
LABEL name="seoz-admin" \
LABEL name="osat-admin" \
version="$VERSION" \
build="$BUILD" \
architecture="x86_64" \
build_date="$NOW" \
vendor="seoz" \
maintainer="Luc Michalski <[email protected]>" \
url="https://github.com/seoz.io/seoz-docker" \
vendor="osat" \
url="https://github.com/osat.io/osat-docker" \
summary="SeoZ project with Docker" \
description="SeoZ project with Docker" \
vcs-type="git" \
vcs-url="https://github.com/seoz.io/seoz-docker" \
vcs-url="https://github.com/osat.io/osat-docker" \
vcs-ref="$VERSION" \
distribution-scope="public"

Expand Down
1 change: 0 additions & 1 deletion admin/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG NODE_VERSION=${NODE_VERSION:-"14"}

FROM mhart/alpine-node:${NODE_VERSION}
MAINTAINER Michalski Luc <[email protected]>

# Import project's dependencies
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion contribs/bert-summary/.env-example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General
NAMESPACE="seoz"
NAMESPACE="osat"

# Tini
TINI_VERSION="v0.19.0"
Expand Down
12 changes: 5 additions & 7 deletions contribs/bert-summary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG PYTHON_VERSION=${PYTHON_VERSION:-"3"}

FROM python:${PYTHON_VERSION}-alpine AS builder
MAINTAINER Michalski Luc <[email protected]>

# change to app dir
WORKDIR /app
Expand Down Expand Up @@ -32,7 +31,7 @@ COPY requirements.txt .
RUN pip3 install -r requirements.txt

FROM python:${PYTHON_VERSION}-alpine AS runtime
MAINTAINER Luc Michalski <[email protected]>


ARG VERSION
ARG BUILD
Expand All @@ -59,18 +58,17 @@ ENV PATH="/opt/venv/bin:$PATH" \
VIRTUAL_ENV="/opt/venv"

# Set container labels
LABEL name="seoz-contrib-bert-summary" \
LABEL name="osat-contrib-bert-summary" \
version="$VERSION" \
build="$BUILD" \
architecture="x86_64" \
build_date="$NOW" \
vendor="seoz" \
maintainer="Luc Michalski <[email protected]>" \
url="https://github.com/seoz.io/seoz-docker" \
vendor="osat" \
url="https://github.com/osat.io/osat-docker" \
summary="SeoZ contrib - YAKE" \
description="SeoZ contrib - YAKE" \
vcs-type="git" \
vcs-url="https://github.com/seoz.io/seoz-docker" \
vcs-url="https://github.com/osat.io/osat-docker" \
vcs-ref="$VERSION" \
distribution-scope="public"

Expand Down
1 change: 0 additions & 1 deletion contribs/bert-summary/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ ARG CUDA_VERSION=${CUDA_VERSION:-"10.2"}
ARG UBUNTU_VERSION=${UBUNTU_VERSION:-"18.04"}

FROM nvidia/cuda:${CUDA_VERSION}-cudnn7-devel-ubuntu${UBUNTU_VERSION}
MAINTAINER Michalski Luc <[email protected]>

RUN apt-get update && \
apt-get install -y sudo \
Expand Down
1 change: 0 additions & 1 deletion contribs/bert-summary/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM ubuntu:18.04
MAINTAINER Michalski Luc <[email protected]>

RUN apt-get update && \
apt-get install -y sudo \
Expand Down
2 changes: 1 addition & 1 deletion contribs/bert-summary/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.8'
services:

bert-summary:
image: seoz/seoz-contrib-bert-summary:latest
image: osat/osat-contrib-bert-summary:latest
container_name: ${NAMESPACE}-contrib-bert-summary
build:
context: .
Expand Down
2 changes: 1 addition & 1 deletion contribs/yake/.env-example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# General
NAMESPACE="seoz"
NAMESPACE="osat"

# Tini
TINI_VERSION="v0.19.0"
Expand Down
12 changes: 5 additions & 7 deletions contribs/yake/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG PYTHON_VERSION=${PYTHON_VERSION:-"3.7.1"}

FROM python:${PYTHON_VERSION}-alpine AS builder
MAINTAINER Michalski Luc <[email protected]>

ARG YAKE_VERSION=${YAKE_VERSION:-"master"}

Expand Down Expand Up @@ -37,7 +36,7 @@ RUN wget https://raw.githubusercontent.com/LIAAD/yake/${YAKE_VERSION}/requiremen
RUN pip3 install git+https://github.com/liaad/yake.git@${YAKE_VERSION}

FROM python:3-alpine AS runtime
MAINTAINER Luc Michalski <[email protected]>


ARG VERSION
ARG BUILD
Expand All @@ -64,18 +63,17 @@ ENV PATH="/opt/venv/bin:$PATH" \
VIRTUAL_ENV="/opt/venv"

# Set container labels
LABEL name="seoz-contrib-yake" \
LABEL name="osat-contrib-yake" \
version="$VERSION" \
build="$BUILD" \
architecture="x86_64" \
build_date="$NOW" \
vendor="seoz" \
maintainer="Luc Michalski <[email protected]>" \
url="https://github.com/seoz.io/seoz-docker" \
vendor="osat" \
url="https://github.com/osat.io/osat-docker" \
summary="SeoZ contrib - YAKE" \
description="SeoZ contrib - YAKE" \
vcs-type="git" \
vcs-url="https://github.com/seoz.io/seoz-docker" \
vcs-url="https://github.com/osat.io/osat-docker" \
vcs-ref="$VERSION" \
distribution-scope="public"

Expand Down
2 changes: 1 addition & 1 deletion contribs/yake/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.8'
services:

yake:
image: seoz/seoz-contrib-yake:latest
image: osat/osat-contrib-yake:latest
container_name: ${NAMESPACE}-contrib-yake
build:
context: .
Expand Down
Loading

0 comments on commit bfa093d

Please sign in to comment.