Coder Social home page Coder Social logo

docker-nginx-static's Introduction

Контейнер для статики (6 mb)

CircleCI

Поддерживает PushState для history API.

Пример Dockerfile'a для проекта.

FROM rg.teamc.io/teamc.io/docker/static:latest

# dist/ - папка с index.html
COPY dist/ /usr/share/nginx/html

# Это обязательно!
USER root
RUN chown -R www-data:www-data /usr/share/nginx/html
USER www-data

Порты

  • 8080

ENV переменные

ENV PORT 8080
ENV NGINX_WEBROOT /usr/share/nginx/html
ENV BASIC_AUTH_ENABLE false
ENV HTPASSWD 'foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.'

При включении Basic Auth, foo:bar логин/пароль по умолчанию.

Можно добавить больше пользователей:

HTPASSWD 'foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.\ntest:$apr1$LKkW8P4Y$P1X/r2YyaexhVL1LzZAQm.'

В примере 2 штуки, foo:bar и test:test.

Запуск

make run

или

docker run --rm -it -p 8080:8080 rg.teamc.io/teamc.io/docker/static:latest

Проверка работоспособности

curl http://localhost:8080

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.