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

13 files changed

+141
-107
lines changed

.devcontainer/Dockerfile

-15
This file was deleted.

.devcontainer/devcontainer.json

-26
This file was deleted.

.devcontainer/docker-compose.yml

-38
This file was deleted.

.devcontainer/postCreateCommand.sh

-11
This file was deleted.

.gitignore

+1
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

-8
This file was deleted.

data/.env

+6
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

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.env.example docker/.env.example

+3-6
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

+100
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"

docker/docker-compose.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: "3.1"
2+
services:
3+
postgres:
4+
image: postgres:12
5+
hostname: postgres
6+
ports:
7+
- "5432:5432"
8+
environment:
9+
POSTGRES_USER: postgres
10+
POSTGRES_PASSWORD: dispatch
11+
POSTGRES_DB: dispatch
12+
volumes:
13+
- postgres-data:/var/lib/postgresql/data
14+
restart: unless-stopped
15+
16+
pgadmin:
17+
image: dpage/pgadmin4
18+
depends_on:
19+
- postgres
20+
ports:
21+
- "5555:80"
22+
environment:
23+
PGADMIN_DEFAULT_EMAIL: [email protected]
24+
PGADMIN_DEFAULT_PASSWORD: admin
25+
restart: unless-stopped
26+
27+
volumes:
28+
postgres-data:

src/dispatch/static/dispatch/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"serve": "cross-env NODE_ENV=dev NODE_OPTIONS='--max-http-header-size=100000' vite",
6+
"serve": "cross-env NODE_ENV=dev NODE_OPTIONS='--max-http-header-size=100000' vite --open",
77
"preview": "vite preview --open --port 8080",
88
"build": "vite build --out-dir dist",
99
"lint": "eslint src",

src/dispatch/static/dispatch/vite.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import Components from "unplugin-vue-components/vite"
88

99
import path from "path"
1010

11-
1211
export default defineConfig({
1312
plugins: [
1413
vue2(),
@@ -25,7 +24,7 @@ export default defineConfig({
2524
port: 8080,
2625
proxy: {
2726
"^/api": {
28-
target: `http://localhost:8000`,
27+
target: "http://127.0.0.1:8000",
2928
ws: false,
3029
changeOrigin: true,
3130
},

0 commit comments

Comments
 (0)