make app docker volume friendly

This commit is contained in:
Rohan Sircar 2021-04-27 16:52:27 +05:30
parent 919e5d3751
commit 81a72578a1
5 changed files with 5 additions and 4 deletions

2
.env
View File

@ -1,3 +1,3 @@
DATABASE_URL=app.db DATABASE_URL=data/app.db
BIND_ADDRESS=127.0.0.1:7800 BIND_ADDRESS=127.0.0.1:7800
HASH_COST=8 HASH_COST=8

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
/target /target
.idea .idea
.vscode .vscode
/app_db.db app.db
/data

BIN
app.db

Binary file not shown.

View File

@ -33,7 +33,7 @@ RUN groupadd $APP_USER \
COPY ./.env ${APP}/.env COPY ./.env ${APP}/.env
COPY ./migrations ${APP}/migrations COPY ./migrations ${APP}/migrations
COPY ./static ${APP}/static COPY ./static ${APP}/static
COPY ./db/empty.db ${APP}/app.db COPY ./db/empty.db ${APP}/data/app.db
COPY --from=builder /actix-demo/target/release/actix-demo ${APP}/actix-demo COPY --from=builder /actix-demo/target/release/actix-demo ${APP}/actix-demo
RUN chown -R $APP_USER:$APP_USER ${APP} RUN chown -R $APP_USER:$APP_USER ${APP}

View File

@ -17,7 +17,7 @@ RUN groupadd $APP_USER \
COPY ./.env ${APP}/.env COPY ./.env ${APP}/.env
COPY ./migrations ${APP}/migrations COPY ./migrations ${APP}/migrations
COPY ./static ${APP}/static COPY ./static ${APP}/static
COPY ./db/empty.db ${APP}/app.db COPY ./db/empty.db ${APP}/data/app.db
COPY ./target/release/actix-demo ${APP}/actix-demo COPY ./target/release/actix-demo ${APP}/actix-demo
RUN chown -R $APP_USER:$APP_USER ${APP} RUN chown -R $APP_USER:$APP_USER ${APP}