Created
February 13, 2019 14:39
-
-
Save electric380v/03066909befddef1d7b1e41719aa9b37 to your computer and use it in GitHub Desktop.
sss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # FROM node:10-alpine | |
| FROM node:11.9.0-alpine as builder | |
| WORKDIR /app | |
| ENV ENV production | |
| ADD . ./ | |
| RUN echo "--->>> install yarn" && \ | |
| yarn install && \ | |
| echo "--->>> Build project" && \ | |
| yarn run build | |
| FROM node:11.9.0-alpine | |
| ADD package.json ./ | |
| ADD nuxt.config.js ./ | |
| COPY --from=builder ./app/server ./server/ | |
| COPY --from=builder ./app/node_modules ./node_modules/ | |
| COPY --from=builder ./app/modules ./modules/ | |
| COPY --from=builder /app/.nuxt/ ./app/.nuxt/ | |
| COPY --from=builder /app/assets/ ./app/assets/ | |
| # Set environment variables | |
| # ENV ENV production | |
| ENV HOST 0.0.0.0 | |
| ENV PORT 3000 | |
| ENV APP_HOME /app | |
| ARG user=web-client | |
| ARG group=web-client | |
| ARG uid=11111 | |
| ARG gid=22222 | |
| WORKDIR /app | |
| # # Install app dependencies | |
| # COPY package.json "$APP_HOME" | |
| # COPY yarn.lock "$APP_HOME" | |
| # # Bundle app source | |
| # COPY . "$APP_HOME" | |
| # RUN apk add --update yarn && \ | |
| # echo "--->>> install yarn" && \ | |
| # yarn install && \ | |
| # echo "--->>> Build project" && \ | |
| # yarn run build && \ | |
| # echo "--->>> add users" && \ | |
| # addgroup -g ${gid} -S ${group} && \ | |
| # adduser -u ${uid} -S ${user} -G ${group} && \ | |
| # chown -R ${user} "$APP_HOME" | |
| # # # Clear the cache | |
| # # RUN yarn cache clean | |
| EXPOSE 3000 | |
| # CMD [ "yarn", "start" ] | |
| CMD [ "yarn", "run", "dev"] | |
| # docker build -f Dockerfile -t web-client:2 . | |
| # docker run -d -p 3000:3000 web-client:2 | |
| # docker run -it -p 3000:3000 web-client:2 | |
| # ### STAGE 1: Build ### | |
| # FROM alpine:latest | |
| # WORKDIR /app | |
| # COPY . . | |
| # RUN apk add --update yarn && \ | |
| # yarn install && \ | |
| # yarn run build && \ | |
| # yarn --version | |
| # # ### STAGE 2: Setup ### | |
| # # FROM alpine:latest | |
| # ENV VERSION=0.0.1 | |
| # ENV apiLink=https://tp-api.dev.ltech.net.ua/v30/ | |
| # ENV PORT=3000 | |
| # ENV APP_HOME /app | |
| # # WORKDIR /app | |
| # # RUN apk add --update yarn | |
| # # COPY --from=builder /app/package.json /app/package.json | |
| # # COPY --from=builder /app/server /app/server/ | |
| # # COPY --from=builder /app/.nuxt/ /app/.nu | |
| # ARG user=web-client | |
| # ARG group=web-client | |
| # ARG uid=11111 | |
| # ARG gid=22222 | |
| # RUN addgroup -g ${gid} -S ${group} && \ | |
| # adduser -u ${uid} -S ${user} -G ${group} | |
| # RUN chown -R ${user} "$APP_HOME" | |
| # EXPOSE "$PORT" | |
| # USER ${user} | |
| # # ENTRYPOINT [ "yarn"] | |
| # CMD ["yarn", "start"] | |
| # # docker build --rm -f ./Dockerfile --tag tp-web:v0.0.2 . | |
| # # sudo docker run -d \ | |
| # # --name tp-web \ | |
| # # web:test | |
| # # sudo docker run --name tp-web tp-web:v0.0.2 | |
| # # sudo docker run -d \ | |
| # # --name consul --net=host \ | |
| # # -p 8500:8500 \ | |
| # # -e 'CONSUL_LOCAL_CONFIG={"skip_leave_on_interrupt": true, "ui": true, "dns_config": { "allow_stale": false }}' \ | |
| # # consul:1.0.0 agent -server -bind="$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)" -client=0.0.0.0 -bootstrap | |
| # # docker run -d -h node1 -v /mnt:/data \ | |
| # # -p 8300:8300 \ | |
| # # -p 8301:8301 \ | |
| # # -p 8301:8301/udp \ | |
| # # -p 8302:8302 \ | |
| # # -p 8302:8302/udp \ | |
| # # -p 8400:8400 \ | |
| # # -p 8500:8500 \ | |
| # # -p 3:53/udp \ | |
| # # progrium/consul -server -advertise 172.28.128.3 -bootstrap-expect 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment