Folder is not copied by docker-compose
I have a problem with coping app folder into image. This problem exists only for folders, files are copied without problems. Also, there is no problem with folders when I run docker run
.
I'm using WSL with docker toolbox and I thought that maybe mounting folders is somehow broken but since I'm able to copy files it can't be the case, right? I have my repo on different disk and I'm coping files with rsync
into folder that's under mounted disk. I'm not sure if that's relevant but maybe I'm missing something.
All commands are run from the same directory where Dockerfile is placed.
Here is my configuration:
Dockerfile
# Pull base image
FROM python:3.6-slim
# Set environment varibles
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
ARG PROJECT=my_project
ARG PROJECT_DIR=/srv/www/${PROJECT}
RUN mkdir -p $PROJECT_DIR
# Copy project
COPY timi $PROJECT_DIR/
COPY docker-entrypoint-local.sh /
RUN chmod u+x /docker-entrypoint-local.sh
RUN apt-get update && apt-get install -y build-essential python3-dev git && pip3 install -r $PROJECT_DIR/requirements.txt
WORKDIR $PROJECT_DIR
EXPOSE 8000
ENTRYPOINT ["/docker-entrypoint-local.sh"]
docker-compose-local.yml
version: '3.6'
services:
db:
image: postgres:10.5-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=dbname
- POSTGRES_USER=my_project_user
- POSTGRES_PASSWORD=really_strong
networks:
- database_network
webapp:
build: .
volumes:
- .:/srv/www
ports:
- 8080:8000
depends_on:
- db
networks:
- database_network
networks:
database_network:
driver: bridge
volumes:
postgres_data:
docker-entrypoint-local.sh
#!/bin/bash
python manage.py runserver 0.0.0.0:8000
tail -f /dev/null
exec "$@"
commands:
docker build . -t my_project
docker-compose -f docker-compose-local.yml up -d
or
docker run -p 8080:8000 my_project
<- this one has no problem with coping folder.
I assume I have problem with mounting but I have no idea what it could be.
docker docker-compose mounted-volumes
add a comment |
I have a problem with coping app folder into image. This problem exists only for folders, files are copied without problems. Also, there is no problem with folders when I run docker run
.
I'm using WSL with docker toolbox and I thought that maybe mounting folders is somehow broken but since I'm able to copy files it can't be the case, right? I have my repo on different disk and I'm coping files with rsync
into folder that's under mounted disk. I'm not sure if that's relevant but maybe I'm missing something.
All commands are run from the same directory where Dockerfile is placed.
Here is my configuration:
Dockerfile
# Pull base image
FROM python:3.6-slim
# Set environment varibles
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
ARG PROJECT=my_project
ARG PROJECT_DIR=/srv/www/${PROJECT}
RUN mkdir -p $PROJECT_DIR
# Copy project
COPY timi $PROJECT_DIR/
COPY docker-entrypoint-local.sh /
RUN chmod u+x /docker-entrypoint-local.sh
RUN apt-get update && apt-get install -y build-essential python3-dev git && pip3 install -r $PROJECT_DIR/requirements.txt
WORKDIR $PROJECT_DIR
EXPOSE 8000
ENTRYPOINT ["/docker-entrypoint-local.sh"]
docker-compose-local.yml
version: '3.6'
services:
db:
image: postgres:10.5-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=dbname
- POSTGRES_USER=my_project_user
- POSTGRES_PASSWORD=really_strong
networks:
- database_network
webapp:
build: .
volumes:
- .:/srv/www
ports:
- 8080:8000
depends_on:
- db
networks:
- database_network
networks:
database_network:
driver: bridge
volumes:
postgres_data:
docker-entrypoint-local.sh
#!/bin/bash
python manage.py runserver 0.0.0.0:8000
tail -f /dev/null
exec "$@"
commands:
docker build . -t my_project
docker-compose -f docker-compose-local.yml up -d
or
docker run -p 8080:8000 my_project
<- this one has no problem with coping folder.
I assume I have problem with mounting but I have no idea what it could be.
docker docker-compose mounted-volumes
add a comment |
I have a problem with coping app folder into image. This problem exists only for folders, files are copied without problems. Also, there is no problem with folders when I run docker run
.
I'm using WSL with docker toolbox and I thought that maybe mounting folders is somehow broken but since I'm able to copy files it can't be the case, right? I have my repo on different disk and I'm coping files with rsync
into folder that's under mounted disk. I'm not sure if that's relevant but maybe I'm missing something.
All commands are run from the same directory where Dockerfile is placed.
Here is my configuration:
Dockerfile
# Pull base image
FROM python:3.6-slim
# Set environment varibles
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
ARG PROJECT=my_project
ARG PROJECT_DIR=/srv/www/${PROJECT}
RUN mkdir -p $PROJECT_DIR
# Copy project
COPY timi $PROJECT_DIR/
COPY docker-entrypoint-local.sh /
RUN chmod u+x /docker-entrypoint-local.sh
RUN apt-get update && apt-get install -y build-essential python3-dev git && pip3 install -r $PROJECT_DIR/requirements.txt
WORKDIR $PROJECT_DIR
EXPOSE 8000
ENTRYPOINT ["/docker-entrypoint-local.sh"]
docker-compose-local.yml
version: '3.6'
services:
db:
image: postgres:10.5-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=dbname
- POSTGRES_USER=my_project_user
- POSTGRES_PASSWORD=really_strong
networks:
- database_network
webapp:
build: .
volumes:
- .:/srv/www
ports:
- 8080:8000
depends_on:
- db
networks:
- database_network
networks:
database_network:
driver: bridge
volumes:
postgres_data:
docker-entrypoint-local.sh
#!/bin/bash
python manage.py runserver 0.0.0.0:8000
tail -f /dev/null
exec "$@"
commands:
docker build . -t my_project
docker-compose -f docker-compose-local.yml up -d
or
docker run -p 8080:8000 my_project
<- this one has no problem with coping folder.
I assume I have problem with mounting but I have no idea what it could be.
docker docker-compose mounted-volumes
I have a problem with coping app folder into image. This problem exists only for folders, files are copied without problems. Also, there is no problem with folders when I run docker run
.
I'm using WSL with docker toolbox and I thought that maybe mounting folders is somehow broken but since I'm able to copy files it can't be the case, right? I have my repo on different disk and I'm coping files with rsync
into folder that's under mounted disk. I'm not sure if that's relevant but maybe I'm missing something.
All commands are run from the same directory where Dockerfile is placed.
Here is my configuration:
Dockerfile
# Pull base image
FROM python:3.6-slim
# Set environment varibles
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
ARG PROJECT=my_project
ARG PROJECT_DIR=/srv/www/${PROJECT}
RUN mkdir -p $PROJECT_DIR
# Copy project
COPY timi $PROJECT_DIR/
COPY docker-entrypoint-local.sh /
RUN chmod u+x /docker-entrypoint-local.sh
RUN apt-get update && apt-get install -y build-essential python3-dev git && pip3 install -r $PROJECT_DIR/requirements.txt
WORKDIR $PROJECT_DIR
EXPOSE 8000
ENTRYPOINT ["/docker-entrypoint-local.sh"]
docker-compose-local.yml
version: '3.6'
services:
db:
image: postgres:10.5-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_DB=dbname
- POSTGRES_USER=my_project_user
- POSTGRES_PASSWORD=really_strong
networks:
- database_network
webapp:
build: .
volumes:
- .:/srv/www
ports:
- 8080:8000
depends_on:
- db
networks:
- database_network
networks:
database_network:
driver: bridge
volumes:
postgres_data:
docker-entrypoint-local.sh
#!/bin/bash
python manage.py runserver 0.0.0.0:8000
tail -f /dev/null
exec "$@"
commands:
docker build . -t my_project
docker-compose -f docker-compose-local.yml up -d
or
docker run -p 8080:8000 my_project
<- this one has no problem with coping folder.
I assume I have problem with mounting but I have no idea what it could be.
docker docker-compose mounted-volumes
docker docker-compose mounted-volumes
asked Nov 23 '18 at 17:50
kebiekebie
4318
4318
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53451080%2ffolder-is-not-copied-by-docker-compose%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53451080%2ffolder-is-not-copied-by-docker-compose%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown