Skip to content

Commit

Permalink
Merge pull request #766 from MTES-MCT/feat/install-dagster
Browse files Browse the repository at this point in the history
Feat/install dagster
  • Loading branch information
rcourivaud authored Jun 11, 2024
2 parents f862db7 + d056f67 commit 374b6ea
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 4 deletions.
34 changes: 34 additions & 0 deletions .docker/dagster/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM python:3.10-slim

# ARG DAGSTER_PASSWORD=zlv
# ARG DAGSTER_USERNAME=zlv

# ENV DAGSTER_PASSWORD=$DAGSTER_PASSWORD
# ENV DAGSTER_USERNAME=$DAGSTER_USERNAME

RUN apt-get update && apt-get install -y nginx apache2-utils

RUN pip install dagster-webserver dagster-postgres dagster-aws

COPY analytics/dagster/requirements.txt .


RUN pip install -r requirements.txt

ENV DAGSTER_HOME=/opt/dagster/dagster_home/

RUN mkdir -p $DAGSTER_HOME

COPY analytics/dagster/dagster.yaml analytics/dagster/workspace.yaml $DAGSTER_HOME

COPY analytics/dagster/src $DAGSTER_HOME/src

WORKDIR $DAGSTER_HOME

# Setup Nginx configuration
RUN htpasswd -cb /etc/nginx/.htpasswd zlv zlv
COPY docker/nginx/nginx.conf /etc/nginx/sites-available/default

EXPOSE 8080 3000

CMD service nginx start && dagster-webserver -h 0.0.0.0 -p 3000
15 changes: 13 additions & 2 deletions analytics/dagster/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ FROM python:3.10-slim

RUN pip install dagster-webserver dagster-postgres dagster-aws

RUN apt-get update && apt-get install -y nginx apache2-utils

RUN ls
# Install dependencies
COPY requirements.txt .


RUN pip install -r requirements.txt

ENV DAGSTER_HOME=/opt/dagster/dagster_home/
Expand All @@ -16,6 +21,12 @@ COPY src/ $DAGSTER_HOME

WORKDIR $DAGSTER_HOME

EXPOSE 3000
# Setup Nginx configuration
RUN htpasswd -cb /etc/nginx/.htpasswd zlv zlv
COPY docker/nginx/nginx.conf /etc/nginx/sites-available/default

# Expose port 80 for the Nginx web server
EXPOSE 8080

CMD nginx -g 'daemon off;' & dagster-webserver -h 0.0.0.0 -p 3000

ENTRYPOINT ["dagster-webserver", "-h", "0.0.0.0", "-p", "3000"]
3 changes: 2 additions & 1 deletion analytics/dagster/dagster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ storage:
env: DAGSTER_PG_HOST
db_name:
env: DAGSTER_PG_DB
port: 5432
port:
env: DAGSTER_PG_PORT

telemetry:
enabled: false
14 changes: 14 additions & 0 deletions analytics/dagster/docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
server {
listen 8080;

location / {
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/.htpasswd;

proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
2 changes: 1 addition & 1 deletion analytics/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
env_file:
- .env
ports:
- 3000:3000
- 8080:8080

postgres:
image: postgres:latest
Expand Down

0 comments on commit 374b6ea

Please sign in to comment.