Production image with own API_URL

This commit is contained in:
Aarni Halinen
2019-12-18 11:10:43 +02:00
parent 26358688e5
commit 0f9dac3565
3 changed files with 19 additions and 14 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ pushd deployment-frontend
docker-compose down
docker pull "$1"
docker-compose up -d frontend
API_URL=http://web.sik.party:8000/api docker-compose up -d frontend
popd
+3 -13
View File
@@ -32,18 +32,8 @@ sass:lint:
ts:build:
image: node:12
stage: build
only:
- master
script:
- API_URL=http://web.sik.party:8000/api npm run build
prod:build:
image: node:12
stage: build
only:
- production
script:
- API_URL=https://sika.sik.party/api npm run build
- npm run build
# test:unit:
# image: node:12
@@ -57,7 +47,7 @@ test:e2e:
only:
- master
script:
- npm run test:e2e
- API_URL=http://web.sik.party:8000/api npm run test:e2e
publish:
stage: publish
@@ -82,7 +72,7 @@ publish_prod:
script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build . -t "$IMAGE_NAME":prod
- docker build . -f Dockerfile.prod -t "$IMAGE_NAME":prod
- docker push "$IMAGE_NAME":prod
deploy_dev:
+15
View File
@@ -0,0 +1,15 @@
FROM node:12-alpine as builder
RUN apk add --no-cache libpng-dev gcc make g++ zlib-dev bash lcms2-dev autoconf automake libtool nasm
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --only-prod
COPY . ./
ENV API_URL https://sika.sik.party/api
CMD npm run build
FROM fnichol/uhttpd AS server
EXPOSE 3000
COPY --from=builder /app/build /www
ENTRYPOINT ["/usr/sbin/run_uhttpd", "-f", "-p", "3000", "-h", "/www", "-E", "/"]