Last active
February 21, 2019 21:03
-
-
Save hazelement/1c7dbbc12caa7708dc36787ebd09f1ca to your computer and use it in GitHub Desktop.
Docker example
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
# /etc/docker/daemon.json | |
{ | |
"data-root": "/home/docker/docker_cache", | |
"insecure-registries":["192.168.59.10:5500"] | |
} |
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
## Steps to install docker on brand new machine | |
1. Install docker and docker-compose | |
* `apt-get install docker docker-compose` | |
* `yum install docker docker-compose` | |
2. Add certain user to docker group, `usermod -aG docker $USER` | |
3. Direct docker to save cache to a specific location, modify `daemon.json` following the `daemon.json` notes. | |
4. If SElinux is enabled, issue this command to allow docker to access sepecified location `chcon -R -t svirt_sandbox_file_t /SOURCEDIR` |
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
version: "3" | |
services: | |
proxy: | |
build: ./proxy | |
networks: | |
- frontend | |
db: | |
image: postgres | |
networks: | |
- backend | |
web: | |
build: . | |
command: python3 manage.py runserver 0.0.0.0:8000 | |
volumes: | |
- .:/code | |
ports: | |
- "8000:8000" | |
depends_on: | |
- db | |
networks: | |
- frontend | |
- backend | |
networks: | |
frontend: | |
# Use a custom driver | |
driver: custom-driver-1 | |
backend: | |
# Use a custom driver which takes special options | |
driver: custom-driver-2 | |
driver_opts: | |
foo: "1" | |
bar: "2" |
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 python:3 | |
ENV PYTHONUNBUFFERED 1 | |
RUN mkdir /code | |
WORKDIR /code | |
ADD requirements.txt /code/ | |
RUN pip install -r requirements.txt | |
ADD . /code/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment