Skip to content

Commit 9cb13e9

Browse files
author
karmaking
committed
fixed pipeline
1 parent 493dac7 commit 9cb13e9

File tree

3 files changed

+10
-27
lines changed

3 files changed

+10
-27
lines changed

.github/apimanager.conf

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
#http {
2-
# server {
3-
# listen 8080 default_server;
4-
# listen [::]:8080 default_server;
5-
6-
server_name apimanager;
1+
server {
2+
listen 8080;
3+
server_name apimanager;
74

85
location / {
96
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -15,13 +12,12 @@
1512
}
1613

1714
location /en/static {
18-
alias /opt/app-root/src;
15+
alias /usr/share/nginx/html;
1916
}
2017
location /es/static {
21-
alias /opt/app-root/src;
18+
alias /usr/share/nginx/html;
2219
}
2320
location /static {
24-
alias /opt/app-root/src;
21+
alias /usr/share/nginx/html;
2522
}
26-
# }
27-
#}
23+
}

Dockerfile

-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
FROM python:3.10
2-
USER root
32
COPY . /app
43
COPY .github/local_settings_container.py /app/apimanager/apimanager/local_settings.py
54
COPY .github/gunicorn.conf.py /app/gunicorn.conf.py
65
RUN pip install -r /app/requirements.txt
76
WORKDIR /app
87
RUN ./apimanager/manage.py migrate
9-
RUN chgrp -R 0 /app && chmod -R g+rwX /app
10-
USER 501
118
WORKDIR /app/apimanager
129
EXPOSE 8000
1310
CMD ["gunicorn", "--bind", ":8000", "--config", "../gunicorn.conf.py", "apimanager.wsgi"]

Dockerfile_nginx

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
FROM python:3.10 AS builder
2-
USER 0
32
COPY . /app
43
RUN cp /app/.github/local_settings_container.py /app/apimanager/apimanager/local_settings.py
54
RUN pip install -r /app/requirements.txt
6-
RUN chown 501 /
7-
RUN chown -R 501 /app
8-
RUN chgrp -R 0 /app && chmod -R g+rwX /app
9-
USER 1001
105
WORKDIR /app
116
RUN python ./apimanager/manage.py collectstatic --noinput
12-
13-
FROM nginx:mainline-alpine
14-
USER 0
15-
#RUN dnf update -y
16-
ADD .github/apimanager.conf "${NGINX_DEFAULT_CONF_PATH}"
17-
COPY --from=builder /app/apimanager/static /opt/app-root/src
18-
RUN chgrp -R 0 /opt/app-root/src/ && chmod -R g+rwX /opt/app-root/src/
19-
USER 1001
7+
FROM nginxinc/nginx-unprivileged:stable
8+
COPY .github/apimanager.conf /etc/nginx/conf.d/
9+
COPY --from=builder /app/apimanager/static /usr/share/nginx/html
2010
CMD nginx -g "daemon off;"
2111

2212

0 commit comments

Comments
 (0)