Skip to content

Commit 7cd50ee

Browse files
authored
Revert "Enhancement/GitHub codespaces (Netflix#2686)" (Netflix#2687)
This reverts commit 722c689.
1 parent 722c689 commit 7cd50ee

File tree

13 files changed

+141
-107
lines changed

13 files changed

+141
-107
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.devcontainer/postCreateCommand.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ ipython_config.py
130130

131131
# Environments
132132
.env
133+
!data/.env
133134
.venv
134135
env/
135136
venv/

bin/dispatch

Lines changed: 0 additions & 8 deletions
This file was deleted.

data/.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# General
2+
LOG_LEVEL=ERROR
3+
STATIC_DIR=""
4+
DATABASE_HOSTNAME=localhost
5+
DATABASE_CREDENTIALS=dispatch:dispatch
6+
DISPATCH_ENCRYPTION_KEY=NJHDWDJ3PbHT8h

docker/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.env.example renamed to docker/.env.example

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# General
22
DISPATCH_UI_URL=""
33

4-
LOG_LEVEL="ERROR"
5-
STATIC_DIR=""
6-
DATABASE_HOSTNAME="localhost"
7-
DATABASE_CREDENTIALS="dispatch:dispatch"
8-
DISPATCH_ENCRYPTION_KEY="NJHDWDJ3PbHT8h"
9-
DISPATCH_JWT_SECRET="foo"
4+
# Persistence
5+
DATABASE_HOSTNAME=""
6+
DATABASE_CREDENTIALS=""
107

118
# Authentication
129
# For basic authentication see: https://hawkins.gitbook.io/dispatch/administration-guide/server#configuration-for-dispatch-auth-provider-basic

docker/Dockerfile

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
FROM python:3.9.7-slim-buster as sdist
2+
3+
LABEL maintainer="[email protected]"
4+
LABEL org.opencontainers.image.title="Dispatch PyPI Wheel"
5+
LABEL org.opencontainers.image.description="PyPI Wheel Builder for Dispatch"
6+
LABEL org.opencontainers.image.url="https://dispatch.io/"
7+
LABEL org.opencontainers.image.source="https://github.com/netflix/dispatch"
8+
LABEL org.opencontainers.image.vendor="Netflix, Inc."
9+
LABEL org.opencontainers.image.authors="[email protected]"
10+
11+
# Get and set up Node for front-end asset building
12+
RUN apt-get update && apt-get install -y --no-install-recommends \
13+
# Needed for fetching stuff
14+
ca-certificates \
15+
wget \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
RUN set -x \
19+
&& wget --quiet -O - https://deb.nodesource.com/setup_16.x | bash - \
20+
&& apt-get install -y nodejs
21+
22+
ARG SOURCE_COMMIT
23+
ENV DISPATCH_BUILD=${SOURCE_COMMIT:-unknown}
24+
LABEL org.opencontainers.image.revision=$SOURCE_COMMIT
25+
LABEL org.opencontainers.image.licenses="https://github.com/netflix/dispatch/blob/${SOURCE_COMMIT:-master}/LICENSE"
26+
27+
ARG DISPATCH_LIGHT_BUILD
28+
ENV DISPATCH_LIGHT_BUILD=${DISPATCH_LIGHT_BUILD}
29+
30+
RUN echo "DISPATCH_LIGHT_BUILD=${DISPATCH_LIGHT_BUILD}"
31+
32+
COPY . /usr/src/dispatch/
33+
RUN export YARN_CACHE_FOLDER="$(mktemp -d)" \
34+
&& cd /usr/src/dispatch \
35+
&& python setup.py bdist_wheel \
36+
&& rm -r "$YARN_CACHE_FOLDER" \
37+
&& mv /usr/src/dispatch/dist /dist
38+
39+
# This is the image to be run
40+
FROM python:3.9.7-slim-buster
41+
42+
LABEL maintainer="[email protected]"
43+
LABEL org.opencontainers.image.title="Dispatch"
44+
LABEL org.opencontainers.image.description="Dispatch runtime image"
45+
LABEL org.opencontainers.image.url="https://github.com/netflix/dispatch"
46+
LABEL org.opencontainers.image.documentation="https://github.com/netflix/dispatch"
47+
LABEL org.opencontainers.image.source="https://github.com/netflix/dispatch"
48+
LABEL org.opencontainers.image.vendor="Netflix, Inc."
49+
LABEL org.opencontainers.image.authors="[email protected]"
50+
51+
52+
# add our user and group first to make sure their IDs get assigned consistently
53+
RUN groupadd -r dispatch && useradd -r -m -g dispatch dispatch
54+
55+
# Sane defaults for pip
56+
ENV PIP_NO_CACHE_DIR=off \
57+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
58+
# Dispatch config params
59+
DISPATCH_CONF=/etc/dispatch
60+
61+
RUN apt-get update && apt-get install -y --no-install-recommends \
62+
# Needed for fetching stuff
63+
ca-certificates \
64+
wget gnupg \
65+
&& rm -rf /var/lib/apt/lists/*
66+
67+
RUN set -x \
68+
&& echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
69+
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
70+
71+
RUN set -x \
72+
&& wget --quiet -O - https://deb.nodesource.com/setup_12.x | bash -
73+
74+
COPY --from=sdist /dist/*.whl /tmp/dist/
75+
RUN set -x \
76+
&& buildDeps="" \
77+
&& apt-get update \
78+
&& apt-get install -y --no-install-recommends $buildDeps \
79+
# remove internal index when internal plugins are seperated
80+
&& pip install -U /tmp/dist/*.whl \
81+
&& apt-get purge -y --auto-remove $buildDeps \
82+
# We install run-time dependencies strictly after
83+
# build dependencies to prevent accidental collusion.
84+
# These are also installed last as they are needed
85+
# during container run and can have the same deps w/
86+
&& apt-get install -y --no-install-recommends \
87+
pkg-config postgresql-client-12 nodejs \
88+
&& apt-get clean \
89+
&& rm -rf /var/lib/apt/lists/* \
90+
&& npm install mjml
91+
92+
EXPOSE 8000
93+
VOLUME /var/lib/dispatch/files
94+
95+
ENTRYPOINT ["dispatch"]
96+
CMD ["server", "start", "dispatch.main:app", "--host=0.0.0.0"]
97+
98+
ARG SOURCE_COMMIT
99+
LABEL org.opencontainers.image.revision=$SOURCE_COMMIT
100+
LABEL org.opencontainers.image.licenses="https://github.com/netflix/dispatch/blob/${SOURCE_COMMIT:-master}/LICENSE"

0 commit comments

Comments
 (0)