Combine PROD and DEV images

This commit is contained in:
Aarni Halinen
2019-11-03 17:01:38 +02:00
parent b23e439eb5
commit dab6f98ec2
4 changed files with 4 additions and 36 deletions
+1 -15
View File
@@ -45,20 +45,6 @@ remark:
script:
- npm run remark
# TODO: remove
publish_dev:
stage: publish
image: docker:stable
services:
- docker:stable-dind
only:
- develop
script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build . -t "$IMAGE_NAME_DEV"
- docker push "$IMAGE_NAME_DEV"
publish:
stage: publish
image: docker:stable
@@ -69,7 +55,7 @@ publish:
script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build . -f Dockerfile.prod -t "$IMAGE_NAME"
- docker build . -t "$IMAGE_NAME"
- docker push "$IMAGE_NAME"
deploy_dev:
+2
View File
@@ -16,3 +16,5 @@ RUN apk add --no-cache python3-dev build-base linux-headers pcre-dev openssl bas
&& pip install -r requirements.production.txt
RUN python manage.py collectstatic --noinput
CMD ["sh", "-c", "./production_entrypoint.sh"]
-20
View File
@@ -1,20 +0,0 @@
FROM python:3.7-alpine
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY requirements.txt ./
COPY requirements.production.txt ./
COPY . ./
# uWSGI, gunicorn etc.
RUN apk add --no-cache python3-dev build-base linux-headers pcre-dev openssl \
# PSQL
&& apk add --no-cache postgresql-dev \
# Pillow
&& apk add --no-cache jpeg-dev zlib-dev \
&& pip install --upgrade pip \
&& pip install -r requirements.txt \
&& pip install -r requirements.production.txt
RUN python manage.py collectstatic --noinput
ENTRYPOINT ["sh", "-c", "./production_entrypoint.sh"]
+1 -1
View File
@@ -7,7 +7,7 @@ services:
- dbdata:/var/lib/postgresql/data
web:
build: .
image: registry.gitlab.com/sahkoinsinoorikilta/vtmk/web2.0-backend:dev
image: registry.gitlab.com/sahkoinsinoorikilta/vtmk/web2.0-backend
command: ["bash", "-c", "cd /app & bash setup.sh --no-input --no-npm && gunicorn -w 4 -b 0.0.0.0:8000 sikweb.wsgi"]
env_file:
- .env.sample