Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Raphaël Courivaud <[email protected]>
  • Loading branch information
rcourivaud committed Jun 11, 2024
1 parent 663c2ef commit 2e1c797
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
18 changes: 9 additions & 9 deletions .docker/dagster/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ FROM python:3.10-slim

# ENV DAGSTER_PASSWORD=$DAGSTER_PASSWORD
# ENV DAGSTER_USERNAME=$DAGSTER_USERNAME
# Set environment variables for Dagster
ENV DAGSTER_HOME=/opt/dagster/dagster_home/ \
DAGSTER_USERNAME=zlv \
DAGSTER_PASSWORD=zlv

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

Expand All @@ -19,6 +15,8 @@ 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
Expand All @@ -27,13 +25,15 @@ COPY analytics/dagster/src $DAGSTER_HOME/src

WORKDIR $DAGSTER_HOME

# Configure Nginx using a custom nginx.conf file
RUN htpasswd -cb /etc/nginx/.htpasswd zlv zlv \
&& rm /etc/nginx/sites-enabled/default \
&& cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup # Backup the original config
RUN htpasswd -cb /etc/nginx/.htpasswd zlv zlv

RUN rm /etc/nginx/sites-enabled/default
ADD analytics/dagster/docker/nginx/nginx.conf /etc/nginx/sites-available/dagster
RUN ln -s /etc/nginx/sites-available/dagster /etc/nginx/sites-enabled/dagster

COPY analytics/dagster/docker/nginx/nginx.conf /etc/nginx/nginx.conf


EXPOSE 8080 3000

CMD nginx -t && service nginx start && dagster-webserver -h 0.0.0.0 -p 3000
CMD service nginx start && dagster-webserver -h 0.0.0.0 -p 3000
25 changes: 13 additions & 12 deletions analytics/dagster/docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
server {
listen 8080;
http {
server {
listen 8080;

location / {
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/.htpasswd;
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;
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;
}
}
}
3. B
}

0 comments on commit 2e1c797

Please sign in to comment.