Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx: fix config and dockerfile #9

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 19 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
# Copyright © 2022 The OSRD Contributors
#
# SPDX-License-Identifier: LGPL-3.0-only

FROM python:3.10-slim as builder

WORKDIR /app

COPY . /app/osrd-images/

RUN python /app/osrd-images/scripts/generate.py > /app/osrd-images/image_path.json

FROM nginx:alpine

COPY nginx.conf /etc/nginx/conf.d
COPY nginx-entrypoint.sh /entrypoint.sh

COPY --from=builder ./app/osrd-images/ /srv

ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]

EXPOSE 80
# Copyright © 2022 The OSRD Contributors
#
# SPDX-License-Identifier: LGPL-3.0-only

# Build json index file
FROM python:3.10-slim AS builder
WORKDIR /app
COPY . /app/osrd-images/
RUN python /app/osrd-images/scripts/generate.py > /app/osrd-images/image_path.json

# Build nginx container
FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx-entrypoint.sh /entrypoint.sh
COPY --from=builder ./app/osrd-images/assets /srv/assets
COPY --from=builder ./app/osrd-images/image_path.json /srv/image_path.json
ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
EXPOSE 80
2 changes: 1 addition & 1 deletion nginx-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

: "${NGINX_PORT:=80}"

sed -i "s|%NGINX_PORT%|${NGINX_PORT}|g" /etc/nginx/conf.d/nginx.conf
sed -i "s|%NGINX_PORT%|${NGINX_PORT}|g" /etc/nginx/conf.d/default.conf

exec "$@"